/**
 * Orion — "Modern" theme
 *
 * Editorial design system inspired by Linear / Notion / Height.
 * - Warm paper background, deep ink text
 * - Flat surfaces, crisp 1px borders, no glassmorphism
 * - Inter / Inter Tight / JetBrains Mono
 *
 * Activated via `body[data-theme="modern"]`. All rules are scoped so the other
 * themes (pastel, dark, light, white, blue) keep working untouched.
 *
 * Loaded AFTER shell.css and pastel-redesign.css so its scoped selectors
 * naturally win the cascade when the theme is active.
 */

/* ------------------------------------------------------------------ */
/* 1. Webfonts                                                          */
/* ------------------------------------------------------------------ */
@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800&family=Inter:wght@400;450;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* ------------------------------------------------------------------ */
/* 2. Tokens                                                            */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] {
  /* New editorial tokens */
  --ink: #0a0a0a;
  --ink-2: #27272a;
  --surface-2: #f5f4f0;
  --surface-3: #ecebe6;
  --border-strong: #d6d3cc;
  --accent-soft: #eff4ff;
  --accent-border: #bfd2fc;

  /* Map onto the legacy variable names used by shell.css + page CSS */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface2: #f5f4f0;
  --surface3: #ecebe6;
  --border: #e7e5e0;
  --border-hover: #d6d3cc;

  --text: #0a0a0a;
  --muted: #6b6b70;
  --dim: #a1a1a8;
  --text-muted: #6b6b70;
  --text-dim: #a1a1a8;

  --accent: #2563eb;
  --accent2: #60a5fa;
  --accent-glow: rgba(37, 99, 235, 0.14);

  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 8px 24px rgba(10, 10, 10, 0.06);
  --shadow-soft: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-pop: 0 1px 2px rgba(10, 10, 10, 0.04), 0 8px 24px rgba(10, 10, 10, 0.06);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  color: var(--ink);
  background: var(--bg);
}

/* ------------------------------------------------------------------ */
/* 3. Reset gradients / glassmorphism from previous themes              */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] {
  background: var(--bg) !important;
}
body[data-theme="modern"]::before,
body[data-theme="modern"]::after {
  display: none !important;
  content: none !important;
}

/* ------------------------------------------------------------------ */
/* 4. Sidebar                                                           */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .layout {
  grid-template-columns: 272px 1fr;
}

body[data-theme="modern"] .sidebar,
body[data-theme="modern"] aside.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body[data-theme="modern"] .sidebar .logo {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

body[data-theme="modern"] .sidebar .logo h1 {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--ink);
}

body[data-theme="modern"] .sidebar .logo span {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-top: 2px;
}

body[data-theme="modern"] .sidebar .nav {
  padding: 12px 10px;
}

body[data-theme="modern"] .sidebar .nav-section {
  margin-bottom: 18px;
}

body[data-theme="modern"] .sidebar .nav-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--dim);
  padding: 0 10px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

body[data-theme="modern"] .sidebar .nav-item {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--ink-2);
  gap: 9px;
}

body[data-theme="modern"] .sidebar .nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

body[data-theme="modern"] .sidebar .nav-item.active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 550;
}

body[data-theme="modern"] .sidebar .nav-item.active::before {
  width: 3px;
  height: 14px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

body[data-theme="modern"] .sidebar .nav-item .icon {
  color: var(--muted);
  font-size: 0.92rem;
}
body[data-theme="modern"] .sidebar .nav-item.active .icon,
body[data-theme="modern"] .sidebar .nav-item:hover .icon {
  color: var(--ink);
}
body[data-theme="modern"] .sidebar .nav-item.active .icon {
  color: var(--accent);
}

/* User card */
body[data-theme="modern"] .sidebar-footer,
body[data-theme="modern"] .sidebar .footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 12px 14px;
}
body[data-theme="modern"] .sidebar-footer-link:hover .user-card,
body[data-theme="modern"] .sidebar .footer-inner:hover {
  background: var(--surface-2);
}
body[data-theme="modern"] .sidebar .avatar,
body[data-theme="modern"] .sidebar .footer-av {
  background: linear-gradient(135deg, #f97316, #ef4444);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 0.7rem;
}

body[data-theme="modern"] .logout-btn {
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
}
body[data-theme="modern"] .logout-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border-strong);
}

/* ------------------------------------------------------------------ */
/* 5. Topbar / hero                                                     */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .topbar,
body[data-theme="modern"] header.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none !important;
}

body[data-theme="modern"] .hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
}
body[data-theme="modern"] .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% -20%, var(--accent-soft), transparent 55%);
  pointer-events: none;
}
body[data-theme="modern"] .hero h1,
body[data-theme="modern"] .hero h2,
body[data-theme="modern"] .page-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
body[data-theme="modern"] .hero h2 {
  font-size: 1.85rem;
}
body[data-theme="modern"] .hero p {
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* 6. Cards, panels, tables                                             */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .card,
body[data-theme="modern"] .panel,
body[data-theme="modern"] .kpi-card,
body[data-theme="modern"] .kpi,
body[data-theme="modern"] .space-card,
body[data-theme="modern"] .note-card,
body[data-theme="modern"] .doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

body[data-theme="modern"] .card:hover,
body[data-theme="modern"] .space-card:hover,
body[data-theme="modern"] .note-card:hover,
body[data-theme="modern"] .doc-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-pop);
  border-color: var(--border-strong);
}

body[data-theme="modern"] .card h3 {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: none !important;
  -webkit-text-fill-color: initial !important;
  border-bottom: 1px solid var(--border);
}

/* Tables */
body[data-theme="modern"] .table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body[data-theme="modern"] .table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
body[data-theme="modern"] .table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s var(--ease);
}
body[data-theme="modern"] .table tbody tr:hover {
  background: var(--surface-2);
}
body[data-theme="modern"] .table tbody td {
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ */
/* 7. Buttons                                                           */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .btn,
body[data-theme="modern"] button.btn {
  border-radius: var(--radius);
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    transform 0.15s var(--ease);
  box-shadow: none;
}
body[data-theme="modern"] .btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: none;
  filter: none;
}

body[data-theme="modern"] .btn.primary,
body[data-theme="modern"] .btn.main {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
body[data-theme="modern"] .btn.primary:hover,
body[data-theme="modern"] .btn.main:hover {
  background: #1f1f23;
  border-color: #1f1f23;
  box-shadow: none;
  transform: none;
}

body[data-theme="modern"] .btn.secondary,
body[data-theme="modern"] .btn.alt {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink-2);
}
body[data-theme="modern"] .btn.secondary:hover,
body[data-theme="modern"] .btn.alt:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

body[data-theme="modern"] .btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ------------------------------------------------------------------ */
/* 8. Form controls                                                     */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .fg input,
body[data-theme="modern"] .fg textarea,
body[data-theme="modern"] .fg select,
body[data-theme="modern"] input[type="text"],
body[data-theme="modern"] input[type="email"],
body[data-theme="modern"] input[type="password"],
body[data-theme="modern"] input[type="number"],
body[data-theme="modern"] input[type="search"],
body[data-theme="modern"] input[type="date"],
body[data-theme="modern"] textarea,
body[data-theme="modern"] select {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--ink) !important;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  padding: 8px 10px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
body[data-theme="modern"] .fg input:focus,
body[data-theme="modern"] .fg textarea:focus,
body[data-theme="modern"] .fg select:focus,
body[data-theme="modern"] input:focus,
body[data-theme="modern"] textarea:focus,
body[data-theme="modern"] select:focus {
  border-color: var(--accent-border) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
}
body[data-theme="modern"] .fg label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* 9. Pills, tags, badges, statuses                                     */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .pill,
body[data-theme="modern"] .tag,
body[data-theme="modern"] .badge,
body[data-theme="modern"] .tag-pill {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink-2) !important;
  border-radius: 999px !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  padding: 2px 8px;
}

body[data-theme="modern"] .pill.admin,
body[data-theme="modern"] .role-pill.admin {
  background: var(--accent-soft) !important;
  border-color: var(--accent-border) !important;
  color: var(--accent) !important;
}
body[data-theme="modern"] .pill.user,
body[data-theme="modern"] .role-pill.member {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
}
body[data-theme="modern"] .role-pill.owner {
  background: rgba(124, 58, 237, 0.12) !important;
  border-color: rgba(124, 58, 237, 0.35) !important;
  color: #7c3aed !important;
}
body[data-theme="modern"] .role-pill.guest {
  background: rgba(180, 83, 9, 0.12) !important;
  border-color: rgba(180, 83, 9, 0.35) !important;
  color: var(--warning) !important;
}

body[data-theme="modern"] .status-pill.todo {
  background: var(--surface-3) !important;
  color: var(--muted) !important;
}
body[data-theme="modern"] .status-pill.doing {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}
body[data-theme="modern"] .status-pill.review {
  background: rgba(180, 83, 9, 0.12) !important;
  color: var(--warning) !important;
}
body[data-theme="modern"] .status-pill.done {
  background: rgba(21, 128, 61, 0.12) !important;
  color: var(--success) !important;
}

/* ------------------------------------------------------------------ */
/* 10. KPIs                                                             */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .kpi-val,
body[data-theme="modern"] .stat .value,
body[data-theme="modern"] .stat-value {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.025em;
  color: var(--ink);
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
body[data-theme="modern"] .kpi-label,
body[data-theme="modern"] .stat .label,
body[data-theme="modern"] .stat-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* 11. Modals, popovers, search palette                                 */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] .modal,
body[data-theme="modern"] .dialog,
body[data-theme="modern"] [class*="modal-backdrop"] {
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body[data-theme="modern"] .modal-content,
body[data-theme="modern"] .dialog-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

body[data-theme="modern"] #global-search,
body[data-theme="modern"] .global-search-modal,
body[data-theme="modern"] [class*="search-palette"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

/* ------------------------------------------------------------------ */
/* 12. Misc — links, scrollbars, focus                                  */
/* ------------------------------------------------------------------ */
body[data-theme="modern"] a {
  color: var(--accent);
}
body[data-theme="modern"] *:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

body[data-theme="modern"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
body[data-theme="modern"] ::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}
body[data-theme="modern"] ::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body[data-theme="modern"] *,
  body[data-theme="modern"] *::before,
  body[data-theme="modern"] *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


/* ================================================================== */
/* 14. Modern sidebar (3-mode shell injected by shell.js)               */
/* ================================================================== */
body[data-theme="modern"] {
  --rail-w: 64px;
  --side-w: 272px;
  --topbar-h: 52px;
}

body[data-theme="modern"][data-sidebar="rail"] .layout {
  grid-template-columns: var(--rail-w) 1fr;
}

body[data-theme="modern"] .layout {
  transition: grid-template-columns 0.25s var(--ease);
}

body[data-theme="modern"] aside.sidebar.modern-side {
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s var(--ease);
}

/* --- Workspace switcher row --- */
body[data-theme="modern"] .ws {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  gap: 4px;
  flex-shrink: 0;
}
body[data-theme="modern"] .ws-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  transition: background 0.15s var(--ease);
  min-width: 0;
}
body[data-theme="modern"] .ws-btn:hover { background: var(--surface-2); }
body[data-theme="modern"] .ws-mark {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
body[data-theme="modern"] .ws-mark svg { width: 14px; height: 14px; }
body[data-theme="modern"] .ws-meta { flex: 1; min-width: 0; }
body[data-theme="modern"] .ws-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-theme="modern"] .ws-plan {
  font-size: 10.5px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-theme="modern"] .ws-caret { color: var(--dim); flex-shrink: 0; }
body[data-theme="modern"] .ws-caret svg { width: 12px; height: 12px; }

body[data-theme="modern"] .icon-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  display: grid; place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  flex-shrink: 0;
}
body[data-theme="modern"] .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
body[data-theme="modern"] .icon-btn svg { width: 15px; height: 15px; }

/* --- Search box (opens ⌘K) --- */
body[data-theme="modern"] .side-search { padding: 10px 10px 6px; }
body[data-theme="modern"] .search-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12.5px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
  font-family: inherit;
}
body[data-theme="modern"] .search-box:hover { background: var(--surface-3); border-color: var(--border-strong); }
body[data-theme="modern"] .search-box svg { width: 14px; height: 14px; flex-shrink: 0; }
body[data-theme="modern"] .search-box .search-label { flex: 1; text-align: left; }
body[data-theme="modern"] .kbd {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--muted);
}

/* --- Quick "Nouveau" button --- */
body[data-theme="modern"] .new-row { padding: 0 10px 8px; }
body[data-theme="modern"] .new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease);
}
body[data-theme="modern"] .new-btn:hover { background: #1f1f23; }
body[data-theme="modern"] .new-btn svg { width: 14px; height: 14px; }
body[data-theme="modern"] .new-btn .kbd { margin-left: auto; background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.18); }

/* --- Nav scrolling area --- */
body[data-theme="modern"] aside.sidebar.modern-side .nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
  scrollbar-width: thin;
}
body[data-theme="modern"] aside.sidebar.modern-side .nav::-webkit-scrollbar { width: 8px; }
body[data-theme="modern"] aside.sidebar.modern-side .nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

body[data-theme="modern"] aside.sidebar.modern-side .nav-section { margin-bottom: 14px; }

body[data-theme="modern"] aside.sidebar.modern-side .nav-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
body[data-theme="modern"] .nav-add {
  width: 18px; height: 18px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--dim);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
body[data-theme="modern"] .nav-add:hover { background: var(--surface-2); color: var(--ink); }
body[data-theme="modern"] .nav-add svg { width: 11px; height: 11px; }

body[data-theme="modern"] aside.sidebar.modern-side .nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: var(--row-pad-y, 7px) 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 12.8px;
  font-weight: 450;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
  position: relative;
  cursor: pointer;
  background: transparent;
}
body[data-theme="modern"] aside.sidebar.modern-side .nav-item:hover { background: var(--surface-2); color: var(--ink); }
body[data-theme="modern"] aside.sidebar.modern-side .nav-item.active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 550;
}
body[data-theme="modern"] aside.sidebar.modern-side .nav-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 14px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
body[data-theme="modern"] .nav-ico {
  width: 16px; height: 16px;
  flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--muted);
}
body[data-theme="modern"] aside.sidebar.modern-side .nav-item:hover .nav-ico { color: var(--ink-2); }
body[data-theme="modern"] aside.sidebar.modern-side .nav-item.active .nav-ico { color: var(--accent); }
body[data-theme="modern"] .nav-ico svg { width: 16px; height: 16px; }
body[data-theme="modern"] .nav-text {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-theme="modern"] .nav-badge {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
body[data-theme="modern"] aside.sidebar.modern-side .nav-item.active .nav-badge {
  background: var(--accent-soft);
  color: var(--accent);
}
body[data-theme="modern"] .nav-grip {
  color: var(--dim);
  opacity: 0;
  cursor: grab;
  transition: opacity 0.15s var(--ease);
}
body[data-theme="modern"] aside.sidebar.modern-side .nav-item:hover .nav-grip { opacity: 1; }
body[data-theme="modern"] .tree-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--accent);
}

/* --- Tree (Espaces section) --- */
body[data-theme="modern"] .tree-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
body[data-theme="modern"] .tree-row:hover { background: var(--surface-2); }
body[data-theme="modern"] .tree-caret { color: var(--dim); transition: transform 0.15s var(--ease); display: grid; place-items: center; width: 11px; }
body[data-theme="modern"] .tree-caret svg { width: 11px; height: 11px; }
body[data-theme="modern"] .tree-row[data-open="true"] > .tree-caret { transform: rotate(90deg); }
body[data-theme="modern"] .tree-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-theme="modern"] .tree-count { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
body[data-theme="modern"] .tree-children { padding-left: 16px; display: none; }
body[data-theme="modern"] .tree-row[data-open="true"] + .tree-children { display: block; }

/* --- User card (bottom) --- */
body[data-theme="modern"] aside.sidebar.modern-side .user {
  border-top: 1px solid var(--border);
  padding: 10px;
  flex-shrink: 0;
}
body[data-theme="modern"] .user-block {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
body[data-theme="modern"] .user-block:hover { background: var(--surface-2); }
body[data-theme="modern"] .user-block .avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  flex-shrink: 0;
}
body[data-theme="modern"] .user-meta { flex: 1; min-width: 0; }
body[data-theme="modern"] .user-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-theme="modern"] .user-role {
  font-size: 10.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- Rail mode (collapsed sidebar) --- */
body[data-theme="modern"][data-sidebar="rail"] .ws-meta,
body[data-theme="modern"][data-sidebar="rail"] .ws-caret,
body[data-theme="modern"][data-sidebar="rail"] .nav-text,
body[data-theme="modern"][data-sidebar="rail"] .nav-badge,
body[data-theme="modern"][data-sidebar="rail"] .nav-grip,
body[data-theme="modern"][data-sidebar="rail"] .nav-section-label,
body[data-theme="modern"][data-sidebar="rail"] .tree-children,
body[data-theme="modern"][data-sidebar="rail"] .tree-name,
body[data-theme="modern"][data-sidebar="rail"] .tree-count,
body[data-theme="modern"][data-sidebar="rail"] .tree-dot,
body[data-theme="modern"][data-sidebar="rail"] .user-meta,
body[data-theme="modern"][data-sidebar="rail"] .label-when-open,
body[data-theme="modern"][data-sidebar="rail"] .search-box .search-label,
body[data-theme="modern"][data-sidebar="rail"] .search-box .kbd,
body[data-theme="modern"][data-sidebar="rail"] .new-btn .new-text,
body[data-theme="modern"][data-sidebar="rail"] .new-btn .kbd {
  display: none !important;
}
body[data-theme="modern"][data-sidebar="rail"] .ws-btn { justify-content: center; padding: 6px; }
body[data-theme="modern"][data-sidebar="rail"] .search-box { justify-content: center; padding: 7px; }
body[data-theme="modern"][data-sidebar="rail"] .new-btn { justify-content: center; padding: 8px; }
body[data-theme="modern"][data-sidebar="rail"] .user-block { justify-content: center; }
body[data-theme="modern"][data-sidebar="rail"] aside.sidebar.modern-side .nav-item { justify-content: center; }
body[data-theme="modern"][data-sidebar="rail"] .tree-row { justify-content: center; }
/* In rail mode, keep ONLY the expand toggle reachable: hide the workspace
   switcher button and the notifications bell, center the lone toggle. */
body[data-theme="modern"][data-sidebar="rail"] .ws { justify-content: center; padding: 0; }
body[data-theme="modern"][data-sidebar="rail"] .ws .ws-btn { display: none; }
body[data-theme="modern"][data-sidebar="rail"] .ws .icon-btn.label-when-open { display: none; }

/* Responsive auto-collapse below 980px */
@media (max-width: 979px) {
  body[data-theme="modern"]:not([data-sidebar-override="expanded"]) .layout {
    grid-template-columns: var(--rail-w) 1fr;
  }
}

/* ================================================================== */
/* 15. Modern topbar                                                    */
/* ================================================================== */
body[data-theme="modern"] .modern-topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 50;
}
body[data-theme="modern"] .crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  min-width: 0;
}
body[data-theme="modern"] .crumb { color: var(--muted); white-space: nowrap; }
body[data-theme="modern"] .crumb.current { color: var(--ink); font-weight: 550; }
body[data-theme="modern"] .crumb-sep { color: var(--dim); display: grid; place-items: center; }
body[data-theme="modern"] .crumb-sep svg { width: 11px; height: 11px; }
body[data-theme="modern"] .crumb a { color: var(--muted); text-decoration: none; }
body[data-theme="modern"] .crumb a:hover { color: var(--ink); }

body[data-theme="modern"] .top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
body[data-theme="modern"] .top-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
  font-family: inherit;
}
body[data-theme="modern"] .top-pill:hover { background: var(--surface-2); border-color: var(--border-strong); }
body[data-theme="modern"] .top-pill svg { width: 13px; height: 13px; }

/* ================================================================== */
/* 16. Command palette ⌘K                                               */
/* ================================================================== */
body[data-theme="modern"] .cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16vh;
  animation: cmdkFadeIn 0.15s var(--ease);
}
body[data-theme="modern"] .cmdk-backdrop.open { display: flex; }
@keyframes cmdkFadeIn { from { opacity: 0; } to { opacity: 1; } }

body[data-theme="modern"] .cmdk-panel {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(10, 10, 10, 0.2), 0 2px 4px rgba(10, 10, 10, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  animation: cmdkSlideIn 0.18s var(--ease);
}
@keyframes cmdkSlideIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

body[data-theme="modern"] .cmdk-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
body[data-theme="modern"] .cmdk-header svg {
  width: 16px; height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}
body[data-theme="modern"] .cmdk-input {
  flex: 1;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  font-size: 14px !important;
  color: var(--ink) !important;
  font-family: "Inter", sans-serif !important;
  padding: 0 !important;
  box-shadow: none !important;
}
body[data-theme="modern"] .cmdk-input::placeholder { color: var(--dim); }
body[data-theme="modern"] .cmdk-esc {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--muted);
  flex-shrink: 0;
}

body[data-theme="modern"] .cmdk-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
body[data-theme="modern"] .cmdk-group {
  padding: 6px 0;
}
body[data-theme="modern"] .cmdk-group-label {
  padding: 6px 16px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
body[data-theme="modern"] .cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  transition: background 0.1s var(--ease);
}
body[data-theme="modern"] .cmdk-item:hover,
body[data-theme="modern"] .cmdk-item.is-selected {
  background: var(--surface-2);
  color: var(--ink);
}
body[data-theme="modern"] .cmdk-item .cmdk-ico {
  width: 16px; height: 16px;
  color: var(--muted);
  flex-shrink: 0;
  display: grid; place-items: center;
}
body[data-theme="modern"] .cmdk-item .cmdk-ico svg { width: 14px; height: 14px; }
body[data-theme="modern"] .cmdk-item .cmdk-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .cmdk-item .cmdk-hint {
  font-size: 10.5px;
  color: var(--dim);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
body[data-theme="modern"] .cmdk-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
body[data-theme="modern"] .cmdk-footer {
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10.5px;
  color: var(--muted);
  flex-shrink: 0;
  background: var(--surface-2);
}
body[data-theme="modern"] .cmdk-footer .kbd { margin-right: 4px; }

/* ================================================================== */
/* 17. Main / Topbar / Content wrapper for Modern dashboard             */
/* ================================================================== */
body[data-theme="modern"] .modern-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}
body[data-theme="modern"] .modern-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 60px;
  scrollbar-width: thin;
  background: var(--bg);
}
body[data-theme="modern"] .modern-content::-webkit-scrollbar { width: 8px; }
body[data-theme="modern"] .modern-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

body[data-theme="modern"] .tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 7px;
  padding: 2px;
}
body[data-theme="modern"] .tab {
  padding: 4px 11px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
body[data-theme="modern"] .tab svg { width: 13px; height: 13px; }
body[data-theme="modern"] .tab:hover { color: var(--ink); }
body[data-theme="modern"] .tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* ================================================================== */
/* 18. Page head (eyebrow + H1 + sub + actions)                         */
/* ================================================================== */
body[data-theme="modern"] .page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 18px;
}
body[data-theme="modern"] .page-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
body[data-theme="modern"] .modern-page-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}
body[data-theme="modern"] .page-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 6px;
  max-width: 560px;
}
body[data-theme="modern"] .head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ================================================================== */
/* 19. Hero "Up Next"                                                   */
/* ================================================================== */
body[data-theme="modern"] .modern-hero {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
body[data-theme="modern"] .modern-hero:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-pop);
}
body[data-theme="modern"] .modern-hero::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto auto;
  width: 280px; height: 280px;
  background: radial-gradient(circle at 70% 30%, var(--accent-soft), transparent 65%);
  pointer-events: none;
  opacity: 0.9;
}
body[data-theme="modern"] .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
  position: relative;
}
body[data-theme="modern"] .hero-pulse {
  width: 6px; height: 6px;
  border-radius: 99px;
  background: var(--accent);
  position: relative;
}
body[data-theme="modern"] .hero-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 99px;
  background: var(--accent);
  opacity: 0.35;
  animation: hero-pulse 1.8s ease-in-out infinite;
}
@keyframes hero-pulse { 0%, 100% { transform: scale(1); opacity: 0.35; } 50% { transform: scale(1.8); opacity: 0; } }
body[data-theme="modern"] .hero-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 6px;
  position: relative;
}
body[data-theme="modern"] .hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  position: relative;
  flex-wrap: wrap;
}
body[data-theme="modern"] .meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
body[data-theme="modern"] .hero-meta svg { width: 12px; height: 12px; }
body[data-theme="modern"] .hero-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  align-items: flex-end;
}
body[data-theme="modern"] .hero-time {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
body[data-theme="modern"] .hero-time-sub {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
body[data-theme="modern"] .task-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
body[data-theme="modern"] .task-tag.high { background: rgba(185,28,28,.08); color: var(--danger); }
body[data-theme="modern"] .task-tag.med { background: rgba(180,83,9,.08); color: var(--warning); }
body[data-theme="modern"] .task-tag.low { background: rgba(21,128,61,.08); color: var(--success); }

/* ================================================================== */
/* 20. KPI strip                                                        */
/* ================================================================== */
body[data-theme="modern"] .kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
body[data-theme="modern"] .kpis-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px;
}
body[data-theme="modern"] .kpis-head-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
body[data-theme="modern"] .kpis .kpi {
  background: var(--surface);
  padding: 18px 20px;
  position: relative;
  transition: background 0.15s;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body[data-theme="modern"] .kpis .kpi:hover { background: var(--surface-2); transform: none; }
body[data-theme="modern"] .kpi-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
body[data-theme="modern"] .kpi-ico {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
}
body[data-theme="modern"] .kpi-ico svg { width: 13px; height: 13px; }
body[data-theme="modern"] .kpi .kpi-label {
  font-size: 11.5px !important;
  color: var(--muted) !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
body[data-theme="modern"] .kpi .kpi-val {
  font-family: "Inter Tight", "Inter", sans-serif !important;
  font-size: 30px !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  line-height: 1 !important;
  color: var(--ink) !important;
}
body[data-theme="modern"] .kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
body[data-theme="modern"] .kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
}
body[data-theme="modern"] .kpi-delta.up { color: var(--success); }
body[data-theme="modern"] .kpi-delta.down { color: var(--danger); }
body[data-theme="modern"] .kpi-delta svg { width: 11px; height: 11px; }
body[data-theme="modern"] .kpi-sub { font-size: 11px; color: var(--muted); }
body[data-theme="modern"] .kpi-spark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 64px;
  height: 24px;
  opacity: 0.5;
}

/* Mobile : 4 KPIs → 2 cols puis 1 col */
@media (max-width: 900px) {
  body[data-theme="modern"] .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  body[data-theme="modern"] .kpis {
    grid-template-columns: 1fr;
  }
  body[data-theme="modern"] .modern-content {
    padding: 18px 14px 80px;
  }
  body[data-theme="modern"] .modern-hero {
    grid-template-columns: 1fr;
    padding: 18px 20px;
  }
  body[data-theme="modern"] .modern-hero .hero-cta {
    align-items: flex-start;
  }
  body[data-theme="modern"] .modern-hero .hero-time {
    text-align: left;
  }
  body[data-theme="modern"] .modern-hero .hero-time-sub {
    text-align: left;
  }
  body[data-theme="modern"] .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  body[data-theme="modern"] .head-actions {
    flex-wrap: wrap;
  }
}

/* ================================================================== */
/* 21. Grid (left col 1.4fr / right col 1fr)                            */
/* ================================================================== */
body[data-theme="modern"] .modern-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
body[data-theme="modern"] .modern-grid > div {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
@media (max-width: 1100px) {
  body[data-theme="modern"] .modern-grid {
    grid-template-columns: 1fr;
  }
}

body[data-theme="modern"] .modern-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body[data-theme="modern"] .modern-card:hover { border-color: var(--border-strong); }
body[data-theme="modern"] .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  gap: 12px;
}
body[data-theme="modern"] .card-head .card-title {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  letter-spacing: -0.01em !important;
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
body[data-theme="modern"] .card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
body[data-theme="modern"] .card-link {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
body[data-theme="modern"] .card-link:hover { color: var(--ink); }
body[data-theme="modern"] .card-body { padding: 0 18px 16px; }

/* ================================================================== */
/* 22. Heatmap 91 days                                                  */
/* ================================================================== */
body[data-theme="modern"] .heatmap {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  padding: 6px 0 10px;
}
body[data-theme="modern"] .heat {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface-2);
  transition: transform 0.12s;
  cursor: pointer;
}
body[data-theme="modern"] .heat:hover {
  transform: scale(1.25);
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
body[data-theme="modern"] .heat.l1 { background: rgba(37,99,235,.18); }
body[data-theme="modern"] .heat.l2 { background: rgba(37,99,235,.4); }
body[data-theme="modern"] .heat.l3 { background: rgba(37,99,235,.7); }
body[data-theme="modern"] .heat.l4 { background: var(--accent); }
body[data-theme="modern"] .heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--muted);
  justify-content: flex-end;
}
body[data-theme="modern"] .heat-legend .heat {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 2px;
  cursor: default;
}

/* ================================================================== */
/* 23. Task rows                                                        */
/* ================================================================== */
body[data-theme="modern"] .task-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 6px;
  border-top: 1px solid var(--border);
}
body[data-theme="modern"] .task-group-head:first-of-type { border-top: 0; }
body[data-theme="modern"] .task-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body[data-theme="modern"] .task-group-label.overdue { color: var(--danger); }
body[data-theme="modern"] .task-group-count {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 600;
}
body[data-theme="modern"] .task-group-count.overdue { background: rgba(185,28,28,.08); color: var(--danger); }

body[data-theme="modern"] .modern-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
}
body[data-theme="modern"] .modern-task:hover { background: var(--surface-2); }
body[data-theme="modern"] .task-check {
  width: 16px; height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 0.15s;
  background: transparent;
  cursor: pointer;
}
body[data-theme="modern"] .task-check:hover { border-color: var(--accent); }
body[data-theme="modern"] .modern-task.done .task-check {
  background: var(--accent);
  border-color: var(--accent);
}
body[data-theme="modern"] .modern-task.done .task-check::after {
  content: "";
  width: 7px; height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(1px,-1px);
}
body[data-theme="modern"] .task-name {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .modern-task.done .task-name {
  color: var(--muted);
  text-decoration: line-through;
}
body[data-theme="modern"] .task-meta {
  font-size: 11px;
  color: var(--muted);
  min-width: 60px;
  text-align: right;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
body[data-theme="modern"] .task-av {
  width: 20px; height: 20px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ================================================================== */
/* 24. Quick capture / Projects / Activity feed                         */
/* ================================================================== */
body[data-theme="modern"] .qc {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
  cursor: text;
}
body[data-theme="modern"] .qc:hover { border-color: var(--accent); background: var(--surface); }
body[data-theme="modern"] .qc-input {
  flex: 1;
  font-size: 13px !important;
  color: var(--ink) !important;
  font-family: inherit !important;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}
body[data-theme="modern"] .qc-input::placeholder { color: var(--muted); }
body[data-theme="modern"] .qc-tools { display: flex; gap: 2px; }
body[data-theme="modern"] .qc-tools .icon-btn { width: 24px; height: 24px; }
body[data-theme="modern"] .qc-tools .icon-btn svg { width: 13px; height: 13px; }

body[data-theme="modern"] .proj-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
body[data-theme="modern"] .proj-row:hover { background: var(--surface-2); }
body[data-theme="modern"] .ring {
  position: relative;
  width: 36px; height: 36px;
}
body[data-theme="modern"] .ring svg { transform: rotate(-90deg); }
body[data-theme="modern"] .ring-track { fill: none; stroke: var(--surface-3); stroke-width: 3; }
body[data-theme="modern"] .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}
body[data-theme="modern"] .ring-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
body[data-theme="modern"] .proj-body .proj-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .proj-body .proj-sub {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
body[data-theme="modern"] .proj-team {
  display: flex;
  align-items: center;
}
body[data-theme="modern"] .proj-team .avatar {
  width: 16px;
  height: 16px;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  border-radius: 4px;
  margin-left: -3px;
  border: 1.5px solid var(--surface);
  display: grid;
  place-items: center;
}
body[data-theme="modern"] .proj-team .avatar:first-child { margin-left: 0; }
body[data-theme="modern"] .proj-arrow {
  color: var(--dim);
  transition: transform 0.15s, color 0.15s;
}
body[data-theme="modern"] .proj-row:hover .proj-arrow {
  color: var(--ink);
  transform: translateX(3px);
}

body[data-theme="modern"] .feed { padding: 4px 0 16px; }
body[data-theme="modern"] .feed-item {
  display: flex;
  gap: 11px;
  padding: 9px 18px;
  position: relative;
}
body[data-theme="modern"] .feed-time {
  font-size: 10.5px;
  color: var(--dim);
  min-width: 38px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
body[data-theme="modern"] .feed-mark {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--border-strong);
  margin-top: 6px;
  flex-shrink: 0;
  position: relative;
}
body[data-theme="modern"] .feed-item:not(:last-child) .feed-mark::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 1px;
  height: calc(100% + 11px);
  background: var(--border);
}
body[data-theme="modern"] .feed-text {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}
body[data-theme="modern"] .feed-text strong { color: var(--ink); font-weight: 600; }
body[data-theme="modern"] .feed-text .ghost { color: var(--muted); }

body[data-theme="modern"] .presence {
  display: flex;
  align-items: center;
}
body[data-theme="modern"] .presence .avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  margin-left: -5px;
  border: 2px solid var(--bg);
  display: grid;
  place-items: center;
  position: relative;
}
body[data-theme="modern"] .presence .avatar:first-child { margin-left: 0; }

/* ================================================================== */
/* 25. View animation                                                   */
/* ================================================================== */
@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
body[data-theme="modern"] .modern-view {
  animation: view-in 0.25s var(--ease);
}

/* When the modern shell is active, hide the legacy main wrapper bits */
body[data-theme="modern"] .legacy-hide-on-modern { display: none !important; }
/* Notes : en mode édition (body.notes-editing), on révèle l'éditeur legacy en
   plein écran par-dessus la grille Modern — l'éditeur n'existe que là. */
body[data-theme="modern"].notes-editing .legacy-hide-on-modern { display: block !important; }
body[data-theme="modern"].notes-editing .modern-content.modern-view { display: none !important; }
body[data-theme="modern"].notes-editing .notes-shell { display: flex !important; height: calc(100vh - 96px); min-height: 480px; }
body[data-theme="modern"].notes-editing .notes-aside { display: none !important; }
body[data-theme="modern"].notes-editing .editor-pane { display: flex !important; flex: 1; min-width: 0; }
/* Bouton « retour à la grille » dans l'en-tête éditeur. */
body[data-theme="modern"] .notes-back-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; padding: 4px 8px; border-radius: 7px; margin-right: auto; }
body[data-theme="modern"] .notes-back-btn:hover { color: var(--ink); background: var(--surface-2); }
body[data-theme="modern"] .notes-back-btn svg { width: 15px; height: 15px; transform: scaleX(-1); }

/* ================================================================== */
/* 26. Notes grid (v2)                                                  */
/* ================================================================== */
body[data-theme="modern"] .notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
body[data-theme="modern"] .note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
}
body[data-theme="modern"] .note:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-pop);
}
body[data-theme="modern"] .note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
body[data-theme="modern"] .note-cat {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--muted);
}
body[data-theme="modern"] .note-date {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}
body[data-theme="modern"] .note-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
body[data-theme="modern"] .note-body {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body[data-theme="modern"] .note-foot {
  font-size: 10.5px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 5px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
body[data-theme="modern"] .note-foot svg {
  width: 11px;
  height: 11px;
}

/* ================================================================== */
/* 27. Auth screen (v2 §13)                                             */
/* ================================================================== */
body[data-theme="modern"] .auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  background: var(--bg);
}
@media (max-width: 900px) {
  body[data-theme="modern"] .auth-shell {
    grid-template-columns: 1fr;
  }
  body[data-theme="modern"] .auth-aside {
    display: none !important;
  }
}
body[data-theme="modern"] .auth-aside {
  background: linear-gradient(160deg, #0a0a0a, #1c1c1f 65%);
  color: #fafaf9;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
body[data-theme="modern"] .auth-aside::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(37,99,235,.25), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(124,58,237,.18), transparent 45%);
  pointer-events: none;
}
body[data-theme="modern"] .auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
body[data-theme="modern"] .auth-logo .ws-mark {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  width: 32px; height: 32px;
  border-radius: 8px;
  color: #fff;
  display: grid; place-items: center;
}
body[data-theme="modern"] .auth-logo .ws-mark svg { width: 18px; height: 18px; }
body[data-theme="modern"] .auth-logo-text {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
body[data-theme="modern"] .auth-pitch {
  position: relative;
  z-index: 1;
  max-width: 420px;
}
body[data-theme="modern"] .auth-pitch h2 {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin-bottom: 14px;
  color: #fafaf9;
}
body[data-theme="modern"] .auth-pitch p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,.7);
}
body[data-theme="modern"] .auth-quote {
  position: relative;
  z-index: 1;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,.75);
  max-width: 420px;
}
body[data-theme="modern"] .auth-quote-author {
  margin-top: 10px;
  font-size: 11.5px;
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  gap: 8px;
}
body[data-theme="modern"] .auth-quote-author .avatar {
  width: 24px; height: 24px;
  border-radius: 6px;
  color: #fff;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 700;
}

body[data-theme="modern"] .auth-main {
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
body[data-theme="modern"] .auth-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 6px;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
body[data-theme="modern"] .auth-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}
body[data-theme="modern"] .auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body[data-theme="modern"] .auth-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  text-transform: none;
}
body[data-theme="modern"] .auth-field input {
  width: 100% !important;
  padding: 11px 14px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  font: inherit !important;
  font-size: 13.5px !important;
  color: var(--ink) !important;
  outline: none !important;
  transition: all 0.15s var(--ease);
}
body[data-theme="modern"] .auth-field input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
body[data-theme="modern"] .auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
body[data-theme="modern"] .auth-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  cursor: pointer;
}
body[data-theme="modern"] .auth-row label input { accent-color: var(--accent); margin: 0; }
body[data-theme="modern"] .auth-row a {
  color: var(--accent);
  font-weight: 550;
  text-decoration: none;
}
body[data-theme="modern"] .auth-submit {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  border: 0;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: opacity 0.15s;
  font-family: inherit;
}
body[data-theme="modern"] .auth-submit:hover { opacity: 0.92; }
body[data-theme="modern"] .auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 6px 0;
}
body[data-theme="modern"] .auth-divider::before,
body[data-theme="modern"] .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
body[data-theme="modern"] .auth-sso {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
body[data-theme="modern"] .auth-sso button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
body[data-theme="modern"] .auth-sso button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
body[data-theme="modern"] .auth-foot {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
body[data-theme="modern"] .auth-foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* ================================================================== */
/* 28. Segmented bar (Permissions, Inbox, etc.)                         */
/* ================================================================== */
body[data-theme="modern"] .seg-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
body[data-theme="modern"] .seg-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
body[data-theme="modern"] .seg-chip svg { width: 13px; height: 13px; }
body[data-theme="modern"] .seg-chip:hover {
  background: var(--surface-2);
  color: var(--ink);
}
body[data-theme="modern"] .seg-chip.active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
body[data-theme="modern"] .seg-count {
  font-size: 10.5px;
  color: var(--dim);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
}
body[data-theme="modern"] .seg-chip.active .seg-count {
  background: var(--surface-3);
  color: var(--ink);
}

/* ================================================================== */
/* 29. Permissions matrix (v2 §12)                                      */
/* ================================================================== */
body[data-theme="modern"] .perm-matrix {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
body[data-theme="modern"] .perm-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  font-size: 12.5px;
}
body[data-theme="modern"] .perm-grid > div {
  padding: 11px 16px;
  border-top: 1px solid var(--border);
}
body[data-theme="modern"] .perm-grid > div:nth-child(-n+5) {
  border-top: 0;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}
body[data-theme="modern"] .perm-grid > div:nth-child(5n+1):nth-child(-n+5) {
  text-align: left;
}
body[data-theme="modern"] .perm-cap {
  font-weight: 500;
  color: var(--ink);
}
body[data-theme="modern"] .perm-cap-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}
body[data-theme="modern"] .perm-cell {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
body[data-theme="modern"] .perm-cell .yes { color: var(--success); }
body[data-theme="modern"] .perm-cell .yes svg { width: 14px; height: 14px; }
body[data-theme="modern"] .perm-cell .no { color: var(--dim); font-size: 14px; }
body[data-theme="modern"] .perm-cell .partial {
  color: var(--warning);
  font-size: 11px;
  font-weight: 600;
}

/* ================================================================== */
/* 30. Public intake form (v2 §14)                                      */
/* ================================================================== */
body[data-theme="modern"] .intake-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px;
  background: var(--bg);
}
body[data-theme="modern"] .intake-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(10,10,10,.03), 0 24px 48px rgba(10,10,10,.06);
}
body[data-theme="modern"] .intake-banner {
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, #0a0a0a, #1f1f24);
  overflow: hidden;
}
body[data-theme="modern"] .intake-banner::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 25% 50%, rgba(37,99,235,.4), transparent 45%),
    radial-gradient(circle at 75% 50%, rgba(249,115,22,.3), transparent 45%);
}
body[data-theme="modern"] .intake-banner-mark {
  position: absolute;
  left: 32px;
  bottom: -22px;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
body[data-theme="modern"] .intake-body { padding: 40px 36px 32px; }
body[data-theme="modern"] .intake-org {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
body[data-theme="modern"] .intake-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.2;
}
body[data-theme="modern"] .intake-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 24px;
}
body[data-theme="modern"] .intake-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 10px;
}
body[data-theme="modern"] .intake-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
body[data-theme="modern"] .intake-meta-item svg { width: 13px; height: 13px; }
body[data-theme="modern"] .intake-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body[data-theme="modern"] .intake-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: 0;
}
body[data-theme="modern"] .intake-field .req { color: var(--danger); margin-left: 3px; }
body[data-theme="modern"] .intake-field .hint-txt {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
body[data-theme="modern"] .intake-input {
  width: 100% !important;
  padding: 10px 13px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  font: inherit !important;
  font-size: 13px !important;
  color: var(--ink) !important;
  outline: none !important;
}
body[data-theme="modern"] .intake-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
body[data-theme="modern"] textarea.intake-input {
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
body[data-theme="modern"] .intake-foot {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
body[data-theme="modern"] .intake-foot-note {
  font-size: 11px;
  color: var(--muted);
}
body[data-theme="modern"] .intake-submit {
  padding: 11px 22px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  border: 0;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-family: inherit;
}
body[data-theme="modern"] .intake-poweredby {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  margin-top: 22px;
}
body[data-theme="modern"] .intake-poweredby strong {
  color: var(--muted);
  font-weight: 600;
}

/* ================================================================== */
/* 31. Tasks table (thead / trow)                                       */
/* ================================================================== */
body[data-theme="modern"] .modern-tt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
body[data-theme="modern"] .thead {
  display: grid;
  grid-template-columns: 32px 1fr 140px 140px 100px 80px;
  gap: 12px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
}
body[data-theme="modern"] .th-check { width: 16px; }
body[data-theme="modern"] .trow {
  display: grid;
  grid-template-columns: 32px 1fr 140px 140px 100px 80px;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  font-size: 12.5px;
}
body[data-theme="modern"] .trow:first-of-type { border-top: 0; }
body[data-theme="modern"] .trow:hover { background: var(--surface-2); }
body[data-theme="modern"] .trow-name {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .trow.done .trow-name {
  color: var(--muted);
  text-decoration: line-through;
}
body[data-theme="modern"] .trow-col {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
}
body[data-theme="modern"] .trow-col.danger {
  color: var(--danger);
  font-weight: 600;
}
body[data-theme="modern"] .trow.overdue { background: rgba(185, 28, 28, 0.025); }

/* Admin table variant */
body[data-theme="modern"] .modern-tt.admin .thead,
body[data-theme="modern"] .modern-tt.admin .trow {
  grid-template-columns: 1.4fr 130px 100px 130px 130px 40px;
}

/* Role pills */
body[data-theme="modern"] .role-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
body[data-theme="modern"] .role-pill.owner { background: rgba(124, 58, 237, 0.1); color: #6d28d9; }
body[data-theme="modern"] .role-pill.admin { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }
body[data-theme="modern"] .role-pill.member { background: var(--surface-2); color: var(--ink-2); }
body[data-theme="modern"] .role-pill.guest { background: rgba(180, 83, 9, 0.1); color: #92400e; }

/* Status pills (projet) */
body[data-theme="modern"] .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
body[data-theme="modern"] .status-pill::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 99px;
  background: currentColor;
}
body[data-theme="modern"] .status-pill.todo { background: var(--surface-2); color: var(--muted); }
body[data-theme="modern"] .status-pill.doing { background: rgba(37, 99, 235, 0.1); color: var(--accent); }
body[data-theme="modern"] .status-pill.review { background: rgba(180, 83, 9, 0.1); color: var(--warning); }
body[data-theme="modern"] .status-pill.done { background: rgba(21, 128, 61, 0.1); color: var(--success); }

/* ================================================================== */
/* 32. Inbox rows                                                       */
/* ================================================================== */
body[data-theme="modern"] .inbox-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 6px;
  border-top: 1px solid var(--border);
}
body[data-theme="modern"] .inbox-group-head:first-child { border-top: 0; }
body[data-theme="modern"] .inbox-row {
  display: grid;
  grid-template-columns: 14px 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
body[data-theme="modern"] .inbox-row:hover { background: var(--surface-2); }
body[data-theme="modern"] .inbox-dot {
  width: 7px; height: 7px;
  border-radius: 99px;
  background: transparent;
  justify-self: center;
}
body[data-theme="modern"] .inbox-row.unread .inbox-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
body[data-theme="modern"] .inbox-row .avatar {
  width: 28px; height: 28px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: grid;
  place-items: center;
}
body[data-theme="modern"] .inbox-body { min-width: 0; }
body[data-theme="modern"] .inbox-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 450;
  line-height: 1.4;
}
body[data-theme="modern"] .inbox-title strong { font-weight: 600; }
body[data-theme="modern"] .inbox-row.unread .inbox-title { font-weight: 550; }
body[data-theme="modern"] .inbox-snippet {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .inbox-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* ================================================================== */
/* 33. Kanban (project view)                                            */
/* ================================================================== */
body[data-theme="modern"] .kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: flex-start;
}
body[data-theme="modern"] .kcol {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 400px;
}
body[data-theme="modern"] .kcol-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 8px;
}
body[data-theme="modern"] .kcol-mark {
  width: 7px; height: 7px;
  border-radius: 99px;
  flex-shrink: 0;
}
body[data-theme="modern"] .kcol-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
body[data-theme="modern"] .kcol-count {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 600;
}
body[data-theme="modern"] .kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body[data-theme="modern"] .kcard:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-pop);
}
body[data-theme="modern"] .kcard.done { opacity: 0.6; }
body[data-theme="modern"] .kcard.done .kcard-title {
  text-decoration: line-through;
  color: var(--muted);
}
body[data-theme="modern"] .kcard-title {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink);
  line-height: 1.4;
}
body[data-theme="modern"] .kcard-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
body[data-theme="modern"] .kcard-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
body[data-theme="modern"] .kcard-due {
  font-size: 10.5px;
  color: var(--muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ================================================================== */
/* 34. Gantt timeline                                                   */
/* ================================================================== */
body[data-theme="modern"] .tl-scroll {
  overflow-x: auto;
  padding: 0 18px 18px;
}
body[data-theme="modern"] .tl-grid {
  min-width: 840px;
  display: flex;
  flex-direction: column;
}
body[data-theme="modern"] .tl-head,
body[data-theme="modern"] .tl-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  min-height: 42px;
}
body[data-theme="modern"] .tl-head {
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
body[data-theme="modern"] .tl-row-label {
  padding: 10px 12px 10px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--border);
}
body[data-theme="modern"] .tl-head .tl-row-label {
  font-size: 10.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
body[data-theme="modern"] .tl-cells {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
  background-size: calc(100%/8) 100%;
  position: relative;
}
body[data-theme="modern"] .tl-week {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 8px;
  display: flex;
  align-items: center;
}
body[data-theme="modern"] .tl-row .tl-cells { padding: 8px 0; }
body[data-theme="modern"] .tl-bar {
  height: 24px;
  border-radius: 6px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 550;
  color: #fff;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  align-self: center;
}
body[data-theme="modern"] .tl-bar:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-pop);
}
body[data-theme="modern"] .tl-bar.done {
  background: linear-gradient(90deg, #15803d, #22c55e);
  color: #fff;
}
body[data-theme="modern"] .tl-bar.in-progress {
  background: linear-gradient(90deg, var(--accent), #60a5fa);
}
body[data-theme="modern"] .tl-bar.planned {
  background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
  border: 1px dashed var(--border-strong);
  color: var(--ink-2);
  font-weight: 600;
}

/* ================================================================== */
/* 35. Calendar (project view)                                          */
/* ================================================================== */
body[data-theme="modern"] .cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  background: var(--border);
  gap: 1px;
  margin-top: 4px;
}
body[data-theme="modern"] .cal-dow {
  background: var(--surface-2);
  text-align: center;
  padding: 8px 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
body[data-theme="modern"] .cal-cell {
  background: var(--surface);
  min-height: 96px;
  padding: 7px 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s;
  cursor: pointer;
}
body[data-theme="modern"] .cal-cell:hover { background: var(--surface-2); }
body[data-theme="modern"] .cal-cell.out {
  background: var(--surface-2);
  opacity: 0.6;
}
body[data-theme="modern"] .cal-num {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
body[data-theme="modern"] .cal-cell.out .cal-num {
  color: var(--dim);
  font-weight: 500;
}
body[data-theme="modern"] .cal-cell.today { background: var(--accent-soft); }
body[data-theme="modern"] .cal-cell.today .cal-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
}
body[data-theme="modern"] .cal-task {
  font-size: 10.5px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
  padding: 2px 5px 2px 7px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--c, var(--accent)) 12%, var(--surface));
  border-left: 2px solid var(--c, var(--accent));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform 0.1s;
}
body[data-theme="modern"] .cal-task.urgent {
  background: color-mix(in oklab, var(--c, var(--accent)) 25%, var(--surface));
  font-weight: 600;
}
body[data-theme="modern"] .cal-task.done {
  opacity: 0.55;
  text-decoration: line-through;
}

/* ================================================================== */
/* 36. Project sub-views (pv tabs)                                      */
/* ================================================================== */
body[data-theme="modern"] .pv { display: none; }
body[data-theme="modern"] .pv.active { display: block; }

/* ================================================================== */
/* 37. Spaces cards                                                     */
/* ================================================================== */
body[data-theme="modern"] .spaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
body[data-theme="modern"] .space-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 175px;
  overflow: hidden;
}
body[data-theme="modern"] .space-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c, var(--accent));
}
body[data-theme="modern"] .space-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-pop);
}
body[data-theme="modern"] .space-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
body[data-theme="modern"] .space-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--c, var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
body[data-theme="modern"] .space-name {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
body[data-theme="modern"] .space-meta {
  font-size: 11.5px;
  color: var(--muted);
}
body[data-theme="modern"] .space-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body[data-theme="modern"] .space-progress {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
body[data-theme="modern"] .space-progress-fill {
  height: 100%;
  background: var(--c, var(--accent));
  border-radius: 99px;
}
body[data-theme="modern"] .space-pct {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ================================================================== */
/* 38. Docs (Notion-like)                                               */
/* ================================================================== */
body[data-theme="modern"] .docs-shell {
  display: block; /* DMS pleine largeur — voir section 42 (rail interne) */
  max-width: none;
}
body[data-theme="modern"] .docs-tree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  height: fit-content;
  position: sticky;
  top: 0;
}
body[data-theme="modern"] .doc-section { margin-bottom: 12px; }
body[data-theme="modern"] .doc-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 6px 6px;
}
body[data-theme="modern"] .doc-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
body[data-theme="modern"] .doc-row:hover { background: var(--surface-2); }
body[data-theme="modern"] .doc-row svg {
  flex-shrink: 0;
  opacity: 0.7;
}
body[data-theme="modern"] .docs-content { padding: 0 6px; }
body[data-theme="modern"] .doc-crumb {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
body[data-theme="modern"] .doc-h1 {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 14px;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
body[data-theme="modern"] .doc-byline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
body[data-theme="modern"] .doc-lead {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 24px;
}
body[data-theme="modern"] .doc-h2 {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 24px 0 10px;
}
body[data-theme="modern"] .doc-p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 14px;
}
body[data-theme="modern"] .doc-callout {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 14px 0;
}

/* ================================================================== */
/* 39. Form builder                                                     */
/* ================================================================== */
body[data-theme="modern"] .builder {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  body[data-theme="modern"] .builder {
    grid-template-columns: 1fr;
  }
}
body[data-theme="modern"] .builder-palette,
body[data-theme="modern"] .builder-props {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  position: sticky;
  top: 0;
}
body[data-theme="modern"] .b-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 6px 8px;
}
body[data-theme="modern"] .b-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: grab;
  transition: all 0.12s;
  border: 1px dashed transparent;
}
body[data-theme="modern"] .b-field:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
body[data-theme="modern"] .builder-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  min-height: 520px;
}

/* ================================================================== */
/* 40. Profil hero (v2 §10)                                             */
/* ================================================================== */
body[data-theme="modern"] .profil-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 22px;
}
body[data-theme="modern"] .profil-hero::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto auto;
  width: 280px; height: 280px;
  background: radial-gradient(circle at 70% 30%, var(--accent-soft), transparent 65%);
  pointer-events: none;
  opacity: 0.9;
}
body[data-theme="modern"] .profil-avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 32px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
body[data-theme="modern"] .profil-meta {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}
body[data-theme="modern"] .profil-name {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}
body[data-theme="modern"] .profil-role {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
body[data-theme="modern"] .profil-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
body[data-theme="modern"] .profil-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--ink-2);
}

/* ================================================================== */
/* 41. Project page reskin (existing /projet.html topbar + content)     */
/* ================================================================== */
body[data-theme="modern"] main .topbar {
  height: var(--topbar-h) !important;
  background: var(--bg) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0 18px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: none !important;
}
body[data-theme="modern"] main .topbar .page-title {
  font-family: "Inter Tight", "Inter", sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  letter-spacing: -0.01em !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  padding: 0 !important;
  margin: 0 !important;
}
body[data-theme="modern"] main .topbar .proj-badge {
  font-size: 10.5px !important;
  padding: 2px 8px !important;
  border-radius: 99px !important;
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  border: 0 !important;
  font-weight: 600 !important;
}
body[data-theme="modern"] main .view-tabs {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  background: var(--surface-2) !important;
  border-radius: 7px !important;
  padding: 2px !important;
  border: 0 !important;
  flex-wrap: nowrap;
  overflow-x: auto;
}
body[data-theme="modern"] main .view-tab {
  padding: 4px 10px !important;
  border-radius: 5px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: all 0.12s !important;
  white-space: nowrap;
  font-family: inherit;
}
body[data-theme="modern"] main .view-tab:hover {
  color: var(--ink) !important;
  background: transparent !important;
  transform: none !important;
  filter: none !important;
}
body[data-theme="modern"] main .view-tab.active {
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  font-weight: 550 !important;
}
body[data-theme="modern"] main .topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
body[data-theme="modern"] main .btn-settings,
body[data-theme="modern"] main .btn-ghost {
  background: transparent !important;
  border: 0 !important;
  width: 30px;
  height: 30px;
  padding: 0 !important;
  border-radius: 6px !important;
  color: var(--muted) !important;
  display: grid;
  place-items: center;
  font-size: 13px !important;
  transition: background 0.12s !important;
  cursor: pointer;
}
body[data-theme="modern"] main .btn-settings:hover,
body[data-theme="modern"] main .btn-ghost:hover {
  background: var(--surface-2) !important;
  color: var(--ink) !important;
  transform: none !important;
}
body[data-theme="modern"] main .btn-new {
  background: var(--ink) !important;
  color: #fff !important;
  border: 1px solid var(--ink) !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  font-weight: 550 !important;
  box-shadow: none !important;
  transition: background 0.15s !important;
}
body[data-theme="modern"] main .btn-new:hover {
  background: #1f1f23 !important;
  transform: none !important;
  filter: none !important;
}

/* Stats bar reskin */
body[data-theme="modern"] main .stats-bar {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  gap: 1px !important;
  background: var(--border) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  margin-bottom: 20px !important;
  padding: 0 !important;
}
body[data-theme="modern"] main .stats-bar .stat-card {
  background: var(--surface) !important;
  padding: 14px 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}
body[data-theme="modern"] main .stats-bar .stat-value {
  font-family: "Inter Tight", "Inter", sans-serif !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  color: var(--ink) !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
body[data-theme="modern"] main .stats-bar .stat-label {
  font-size: 11px !important;
  color: var(--muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600 !important;
}

/* Project breadcrumb (injected via JS) */
body[data-theme="modern"] .pj-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
body[data-theme="modern"] .pj-crumbs .crumb { color: var(--muted); }
body[data-theme="modern"] .pj-crumbs .crumb.current { color: var(--ink); font-weight: 550; }
body[data-theme="modern"] .pj-crumbs .crumb a { color: var(--muted); text-decoration: none; }
body[data-theme="modern"] .pj-crumbs .crumb a:hover { color: var(--ink); }

/* Kanban / Liste / Calendar legacy → re-skin via existing classes */
body[data-theme="modern"] main .kanban-board,
body[data-theme="modern"] main .gantt-container,
body[data-theme="modern"] main .calendar-view,
body[data-theme="modern"] main .list-view {
  background: transparent !important;
}

/* ================================================================== */
/* 42. Docs page reskin (existing /docs.html)                           */
/* ================================================================== */
/* La vue Documents porte désormais son propre rail (DMS). L'ancienne grille
   « aside 260px + main 1fr » coinçait .docs-main dans la colonne de 260px une
   fois .docs-aside masqué → on repasse en bloc pleine largeur. */
body[data-theme="modern"] .docs-shell {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  max-width: none !important;
  background: var(--bg) !important;
  min-height: calc(100vh - var(--topbar-h)) !important;
}
body[data-theme="modern"] .docs-aside {
  background: var(--surface) !important;
  border-right: 1px solid var(--border) !important;
  padding: 14px !important;
  backdrop-filter: none !important;
}
body[data-theme="modern"] .docs-aside .docs-search-wrap {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 0 !important;
  box-shadow: none !important;
}
body[data-theme="modern"] .docs-aside .docs-search {
  background: transparent !important;
  border: 0 !important;
  color: var(--ink) !important;
  font-size: 12.5px !important;
}
body[data-theme="modern"] .docs-main {
  padding: 32px 48px !important;
  background: var(--bg) !important;
}
body[data-theme="modern"] .docs-main h1,
body[data-theme="modern"] .docs-main .gallery-title h2 {
  font-family: "Inter Tight", "Inter", sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--ink) !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
body[data-theme="modern"] .btn-new-space {
  background: var(--ink) !important;
  color: #fff !important;
  border: 1px solid var(--ink) !important;
  border-radius: 6px !important;
  padding: 8px !important;
  font-size: 12.5px !important;
  font-weight: 550 !important;
  box-shadow: none !important;
}
body[data-theme="modern"] .btn-new-space:hover {
  background: #1f1f23 !important;
  transform: none !important;
}

/* ================================================================== */
/* 43. Form-builder page reskin (existing /form-builder.html)           */
/* ================================================================== */
body[data-theme="modern"] main .builder-shell,
body[data-theme="modern"] main .fb-shell,
body[data-theme="modern"] main .form-builder-shell {
  background: var(--bg) !important;
}
body[data-theme="modern"] main .fb-palette,
body[data-theme="modern"] main .fb-canvas,
body[data-theme="modern"] main .fb-props {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body[data-theme="modern"] main .fb-field-block {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
body[data-theme="modern"] main .fb-field-block.selected,
body[data-theme="modern"] main .fb-field-block.active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

/* ================================================================== */
/* 44. Workspace switcher dropdown (.ws-menu) — v3                      */
/* ================================================================== */
body[data-theme="modern"] aside.sidebar.modern-side .ws {
  position: relative; /* anchor for ws-menu */
}
body[data-theme="modern"] .ws-menu {
  position: absolute;
  top: 48px;
  left: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: all 0.15s var(--ease);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
body[data-theme="modern"] .ws.open .ws-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
body[data-theme="modern"] .ws-menu-section {
  padding: 6px 4px;
  border-top: 1px solid var(--border);
}
body[data-theme="modern"] .ws-menu-section:first-child { border-top: 0; }
body[data-theme="modern"] .ws-menu-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 8px 6px;
}
body[data-theme="modern"] .ws-menu-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
}
body[data-theme="modern"] .ws-menu-user .avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}
body[data-theme="modern"] .ws-menu-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .ws-menu-user-email {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .ws-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s;
  min-width: 0;
}
body[data-theme="modern"] .ws-item:hover { background: var(--surface-2); }
body[data-theme="modern"] .ws-item.active { background: var(--surface-2); }
body[data-theme="modern"] .ws-item .ws-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex-shrink: 0;
  color: #fff;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  background: var(--ink);
}
body[data-theme="modern"] .ws-item .ws-mark svg { width: 15px; height: 15px; }
body[data-theme="modern"] .ws-item-body { flex: 1; min-width: 0; line-height: 1.2; }
body[data-theme="modern"] .ws-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .ws-item-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .ws-item-tick {
  color: var(--accent);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
body[data-theme="modern"] .ws-item-meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
body[data-theme="modern"] .ws-mark-ghost {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  border: 1px dashed var(--border-strong);
}
body[data-theme="modern"] .ws-mark-ghost svg { width: 14px; height: 14px; }
body[data-theme="modern"] .ws-item-action:hover .ws-mark-ghost {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}
body[data-theme="modern"] .ws-menu-foot {
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
body[data-theme="modern"] .ws-foot-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}
body[data-theme="modern"] .ws-foot-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}
body[data-theme="modern"] .ws-foot-link svg { color: var(--muted); flex-shrink: 0; }
body[data-theme="modern"] .ws-foot-link.ws-foot-danger { color: var(--danger); }
body[data-theme="modern"] .ws-foot-link.ws-foot-danger:hover { background: rgba(185, 28, 28, 0.06); }
body[data-theme="modern"] .ws-foot-link.ws-foot-danger svg { color: var(--danger); }

/* Hide menu in rail mode */
body[data-theme="modern"][data-sidebar="rail"] .ws-menu { display: none; }

/* ================================================================== */
/* 45. Inspector slide-in (.inspector) — v3                             */
/* ================================================================== */
body[data-theme="modern"] .orion-inspector {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 40px rgba(10, 10, 10, 0.06);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  z-index: 8500;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}
body[data-theme="modern"] .orion-inspector.open {
  transform: translateX(0);
  visibility: visible;
}
body[data-theme="modern"] .orion-inspector .inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  flex-shrink: 0;
}
body[data-theme="modern"] .inspector-head-title {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body[data-theme="modern"] .orion-inspector .inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
body[data-theme="modern"] .insp-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 14px;
}
body[data-theme="modern"] .insp-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 9px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
body[data-theme="modern"] .insp-row:last-of-type { border-bottom: 0; }
body[data-theme="modern"] .insp-key { color: var(--muted); font-weight: 500; }
body[data-theme="modern"] .insp-val {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
body[data-theme="modern"] .insp-desc {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
body[data-theme="modern"] .insp-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ================================================================== */
/* 46. Hint bar (.hint) — v3                                            */
/* ================================================================== */
body[data-theme="modern"] .orion-hint {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(10, 10, 10, 0.18);
  z-index: 60;
  animation: hint-in 0.5s var(--ease) 0.8s both;
}
@keyframes hint-in {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
body[data-theme="modern"] .orion-hint .kbd {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  color: rgba(255, 255, 255, 0.85);
}
body[data-theme="modern"] .orion-hint .hint-close {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  line-height: 1;
  margin-left: 4px;
}
body[data-theme="modern"] .orion-hint.dismissed { display: none; }

/* ================================================================== */
/* 47. Tweaks panel (.tweaks) — v3                                      */
/* ================================================================== */
body[data-theme="modern"] .orion-tweaks-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  z-index: 55;
  box-shadow: var(--shadow-pop);
  transition: all 0.15s var(--ease);
}
body[data-theme="modern"] .orion-tweaks-trigger:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}
body[data-theme="modern"] .orion-tweaks-trigger svg { width: 16px; height: 16px; }
body[data-theme="modern"] .orion-tweaks {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  padding: 14px;
  z-index: 60;
  display: none;
  font-size: 12.5px;
}
body[data-theme="modern"] .orion-tweaks.open { display: block; }
body[data-theme="modern"] .tweaks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
body[data-theme="modern"] .tweaks-title {
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
body[data-theme="modern"] .tweaks-close {
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
body[data-theme="modern"] .tw-row { margin-bottom: 12px; }
body[data-theme="modern"] .tw-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}
body[data-theme="modern"] .tw-seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
body[data-theme="modern"] .tw-opt {
  flex: 1;
  padding: 5px 0;
  border-radius: 5px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
  transition: all 0.12s;
  cursor: pointer;
  background: transparent;
  border: 0;
  font-family: inherit;
}
body[data-theme="modern"] .tw-opt.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
body[data-theme="modern"] .tw-swatch-row {
  display: flex;
  gap: 6px;
}
body[data-theme="modern"] .tw-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
  position: relative;
}
body[data-theme="modern"] .tw-swatch.active {
  border-color: var(--ink);
  transform: scale(1.04);
}

/* ================================================================== */
/* 48. Default SVG sizes — CRITIQUE                                     */
/*                                                                      */
/* modernSvg() (shell.js + tous les modules modern-*) produit           */
/*   <svg><use href="/icons.svg#X"/></svg>                              */
/* sans attributs width/height. Sans règle CSS explicite, le navigateur */
/* dessine le SVG à 300×150 (taille par défaut UA), ce qui fait         */
/* "exploser" les icônes dans les boutons / chips / dropdowns.          */
/*                                                                      */
/* Cette section pose les tailles attendues par contexte, et termine    */
/* par un catch-all défensif (16×16) pour tout SVG résiduel.            */
/* ================================================================== */

/* Boutons standard : .btn / .btn.primary / .btn.main / .btn.alt / .btn.secondary / .btn.danger */
body[data-theme="modern"] .btn svg,
body[data-theme="modern"] .btn.primary svg,
body[data-theme="modern"] .btn.main svg,
body[data-theme="modern"] .btn.alt svg,
body[data-theme="modern"] .btn.secondary svg,
body[data-theme="modern"] .btn.danger svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Boutons "Nouveau" et "btn-new" (projet topbar) */
body[data-theme="modern"] .new-btn svg,
body[data-theme="modern"] main .btn-new svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Workspace dropdown items */
body[data-theme="modern"] .ws-item .ws-mark svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
body[data-theme="modern"] .ws-mark-ghost svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
body[data-theme="modern"] .ws-item-tick svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
body[data-theme="modern"] .ws-foot-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
body[data-theme="modern"] .ws-mark svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
body[data-theme="modern"] .ws-caret svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Page-head actions */
body[data-theme="modern"] .head-actions svg,
body[data-theme="modern"] .head-actions .btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Hero CTA */
body[data-theme="modern"] .hero-cta .btn svg,
body[data-theme="modern"] .modern-hero .btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Card link + small chevrons */
body[data-theme="modern"] .card-link svg,
body[data-theme="modern"] .proj-arrow svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

/* Tree caret + dots (modern-sidebar-tree) */
body[data-theme="modern"] .tree-caret svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

/* Notes / Tasks / KPI deltas / Status pill (déjà OK mais on confirme) */
body[data-theme="modern"] .note-foot svg,
body[data-theme="modern"] .meta-chip svg,
body[data-theme="modern"] .feed-text svg,
body[data-theme="modern"] .intake-meta-item svg,
body[data-theme="modern"] .seg-chip svg,
body[data-theme="modern"] .tab svg,
body[data-theme="modern"] .crumb-sep svg {
  flex-shrink: 0;
}

/* Inspector head buttons */
body[data-theme="modern"] .orion-inspector .icon-btn svg {
  width: 14px;
  height: 14px;
}

/* Catch-all défensif : tout SVG <use> qui n'a pas attribut width attribué
 * par le HTML et pas matché par une règle ci-dessus → bornage 16×16.
 * Évite le défaut UA 300×150 qui casse complètement le layout. */
body[data-theme="modern"] svg:not([width]) {
  width: 16px;
  height: 16px;
}

/* Exceptions au catch-all : les SVG qui ont besoin d'occuper toute leur boîte
 * (sparklines, rings, etc.) sont préservées par leur règle dédiée plus haut. */
body[data-theme="modern"] .kpi-spark,
body[data-theme="modern"] .ring svg {
  width: auto;
  height: auto;
}
body[data-theme="modern"] .kpi-spark {
  width: 64px;
  height: 24px;
}
body[data-theme="modern"] .ring svg {
  width: 36px;
  height: 36px;
}

/* ================================================================== */
/* 49. Add menu (Nouveau dropdown)                                      */
/* ================================================================== */
body[data-theme="modern"] .add-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 4px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: all 0.15s var(--ease);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
body[data-theme="modern"] .new-row.open .add-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
body[data-theme="modern"] .add-menu-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
body[data-theme="modern"] .add-menu-item:hover { background: var(--surface-2); }
body[data-theme="modern"] .add-menu-ico {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
body[data-theme="modern"] .add-menu-ico svg { width: 14px; height: 14px; }
body[data-theme="modern"] .add-menu-item:hover .add-menu-ico { background: var(--accent-soft); color: var(--accent); }
body[data-theme="modern"] .add-menu-body { min-width: 0; line-height: 1.25; }
body[data-theme="modern"] .add-menu-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
body[data-theme="modern"] .add-menu-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-theme="modern"] .add-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}
/* Hide menu entirely in rail mode (no anchor) */
body[data-theme="modern"][data-sidebar="rail"] .add-menu { display: none; }

/* ================================================================== */
/* 50. Section Épinglés (sidebar)                                       */
/* ================================================================== */
body[data-theme="modern"] #orion-pins-section .nav-item {
  position: relative;
  padding-right: 26px; /* place pour le × Unpin */
}
body[data-theme="modern"] #orion-pins-section .nav-grip {
  color: var(--dim);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.12s;
  display: grid;
  place-items: center;
}
body[data-theme="modern"] #orion-pins-section .nav-item:hover .nav-grip { opacity: 1; }
body[data-theme="modern"] .orion-pin-unpin {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: transparent;
  border: 0;
  color: var(--dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
  display: grid;
  place-items: center;
  font-family: inherit;
}
body[data-theme="modern"] #orion-pins-section .nav-item:hover .orion-pin-unpin {
  opacity: 1;
}
body[data-theme="modern"] .orion-pin-unpin:hover {
  color: var(--danger);
  background: rgba(185, 28, 28, 0.1);
}
body[data-theme="modern"] .orion-pins-empty {
  font-size: 10.5px;
  color: var(--dim);
  font-style: italic;
  padding: 6px 10px 4px;
  line-height: 1.4;
}
body[data-theme="modern"][data-sidebar="rail"] .orion-pins-empty { display: none; }
body[data-theme="modern"][data-sidebar="rail"] .orion-pin-unpin { display: none; }

/* Bouton "épingler" inline (utilisé sur les pages) */
body[data-theme="modern"] .orion-pin-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}
body[data-theme="modern"] .orion-pin-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border-strong);
}
body[data-theme="modern"] .orion-pin-btn.pinned {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}
body[data-theme="modern"] .orion-pin-btn svg {
  width: 11px;
  height: 11px;
}

/* ================================================================== */
/* 51. Projet — Refonte des 4 sous-vues legacy (kanban / gantt /        */
/* liste / calendar)                                                    */
/* ================================================================== */

/* --- KANBAN (.kanban-col / .kanban-card) → look v3 (.kcol / .kcard) */
body[data-theme="modern"] main .kanban-col {
  background: var(--surface-2) !important;
  border: 0 !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 6px !important;
}
body[data-theme="modern"] main .kanban-col-header,
body[data-theme="modern"] main .kanban-col-head {
  padding: 6px 8px !important;
  background: transparent !important;
  border: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
body[data-theme="modern"] main .kanban-col-header .col-title,
body[data-theme="modern"] main .kanban-col-name {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
body[data-theme="modern"] main .kanban-col-count {
  font-size: 10.5px !important;
  color: var(--muted) !important;
  background: var(--surface) !important;
  padding: 1px 7px !important;
  border-radius: 99px !important;
  font-weight: 600 !important;
}
body[data-theme="modern"] main .kanban-cards {
  padding: 4px !important;
  gap: 6px !important;
}
body[data-theme="modern"] main .kanban-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  box-shadow: none !important;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  backdrop-filter: none !important;
}
body[data-theme="modern"] main .kanban-card:hover {
  border-color: var(--border-strong) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-pop) !important;
}
body[data-theme="modern"] main .kanban-card .card-title {
  font-size: 12.5px !important;
  font-weight: 550 !important;
  color: var(--ink) !important;
  line-height: 1.4 !important;
}
body[data-theme="modern"] main .kanban-card .card-meta,
body[data-theme="modern"] main .kanban-card .card-footer {
  font-size: 10.5px !important;
  color: var(--muted) !important;
}

/* --- GANTT (legacy .gantt-task / .gantt-bar → modern .tl-bar look) */
body[data-theme="modern"] main .gantt-task,
body[data-theme="modern"] main .gantt-bar {
  border-radius: 6px !important;
  height: 24px !important;
  font-size: 11px !important;
  font-weight: 550 !important;
  padding: 0 10px !important;
  border: 0 !important;
  box-shadow: none !important;
  transition: transform 0.12s, box-shadow 0.12s;
}
body[data-theme="modern"] main .gantt-task.done,
body[data-theme="modern"] main .gantt-bar.done {
  background: linear-gradient(90deg, #15803d, #22c55e) !important;
  color: #fff !important;
}
body[data-theme="modern"] main .gantt-task.in-progress,
body[data-theme="modern"] main .gantt-bar.in-progress {
  background: linear-gradient(90deg, var(--accent), #60a5fa) !important;
  color: #fff !important;
}
body[data-theme="modern"] main .gantt-task:hover,
body[data-theme="modern"] main .gantt-bar:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-pop);
}
body[data-theme="modern"] main .gantt-wrap,
body[data-theme="modern"] main .gantt-container {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* --- LISTE legacy (.task-table) → look modern table */
body[data-theme="modern"] main .task-table {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body[data-theme="modern"] main .task-table thead th,
body[data-theme="modern"] main .liste-head,
body[data-theme="modern"] main .table-head {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 9px 14px !important;
  border-bottom: 1px solid var(--border) !important;
}
body[data-theme="modern"] main .task-table tbody tr,
body[data-theme="modern"] main .liste-row {
  border-top: 1px solid var(--border) !important;
  transition: background 0.12s !important;
}
body[data-theme="modern"] main .task-table tbody tr:hover,
body[data-theme="modern"] main .liste-row:hover {
  background: var(--surface-2) !important;
}
body[data-theme="modern"] main .task-table tbody td {
  font-size: 12.5px !important;
  color: var(--ink-2) !important;
  padding: 10px 14px !important;
}

/* --- CALENDRIER legacy (.cal-day / .calendar-day) */
body[data-theme="modern"] main .calendar-grid,
body[data-theme="modern"] main .cal-grid {
  background: var(--border) !important;
  gap: 1px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}
body[data-theme="modern"] main .cal-day,
body[data-theme="modern"] main .calendar-day {
  background: var(--surface) !important;
  border: 0 !important;
  min-height: 96px !important;
  padding: 7px 8px !important;
  transition: background 0.12s !important;
}
body[data-theme="modern"] main .cal-day:hover,
body[data-theme="modern"] main .calendar-day:hover {
  background: var(--surface-2) !important;
}
body[data-theme="modern"] main .cal-day.today,
body[data-theme="modern"] main .calendar-day.today {
  background: var(--accent-soft) !important;
}
body[data-theme="modern"] main .cal-day .day-num,
body[data-theme="modern"] main .calendar-day-num {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: var(--ink-2) !important;
}
body[data-theme="modern"] main .cal-day.today .day-num,
body[data-theme="modern"] main .calendar-day.today .calendar-day-num {
  background: var(--accent) !important;
  color: #fff !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 99px !important;
}
body[data-theme="modern"] main .cal-day .cal-event,
body[data-theme="modern"] main .calendar-event,
body[data-theme="modern"] main .calendar-day-task {
  font-size: 10.5px !important;
  font-weight: 500 !important;
  padding: 2px 5px 2px 7px !important;
  border-radius: 3px !important;
  border-left: 2px solid var(--accent) !important;
  background: color-mix(in oklab, var(--accent) 12%, var(--surface)) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* --- Filtres legacy (.proj-filter, .filter-chip) → look segmented bar */
body[data-theme="modern"] main .proj-filter,
body[data-theme="modern"] main .table-filter,
body[data-theme="modern"] main .filter-chip-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-bottom: 14px !important;
}
body[data-theme="modern"] main .proj-filter button,
body[data-theme="modern"] main .filter-chip {
  padding: 6px 11px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  transition: all 0.12s !important;
  cursor: pointer !important;
  font-family: inherit !important;
}
body[data-theme="modern"] main .proj-filter button:hover,
body[data-theme="modern"] main .filter-chip:hover {
  background: var(--surface-2) !important;
  color: var(--ink) !important;
}
body[data-theme="modern"] main .proj-filter button.active,
body[data-theme="modern"] main .filter-chip.active {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--border) !important;
}

/* ================================================================== */
/* 52. Modal "Nouvelle tâche" modern (.cmod-*)                          */
/* ================================================================== */
body[data-theme="modern"] .cmod-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px 20px;
  animation: cmodFadeIn 0.15s var(--ease);
}
body[data-theme="modern"] .cmod-overlay.open { display: flex; }
@keyframes cmodFadeIn { from { opacity: 0; } to { opacity: 1; } }

body[data-theme="modern"] .cmod {
  width: 700px;
  max-width: 100%;
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(10, 10, 10, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cmodSlideIn 0.2s var(--ease);
}
@keyframes cmodSlideIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

body[data-theme="modern"] .cmod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
body[data-theme="modern"] .cmod-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
body[data-theme="modern"] .cmod-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}
body[data-theme="modern"] .cmod-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

body[data-theme="modern"] .cmod-body {
  padding: 24px 26px 12px;
  overflow-y: auto;
  flex: 1;
}
body[data-theme="modern"] .cmod-title {
  width: 100% !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  font-family: "Inter Tight", "Inter", sans-serif !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em !important;
  color: var(--ink) !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body[data-theme="modern"] .cmod-title::placeholder { color: var(--dim); }
body[data-theme="modern"] .cmod-title.cmod-invalid {
  border-bottom-color: var(--danger) !important;
  animation: cmodShake 0.4s var(--ease);
}
@keyframes cmodShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}
body[data-theme="modern"] .cmod-desc {
  width: 100% !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  font-family: "Inter", sans-serif !important;
  font-size: 13.5px !important;
  color: var(--ink-2) !important;
  padding: 14px 0 16px !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 60px;
  resize: vertical;
  line-height: 1.5;
}
body[data-theme="modern"] .cmod-desc::placeholder { color: var(--dim); }

body[data-theme="modern"] .cmod-rows {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
body[data-theme="modern"] .cmod-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
body[data-theme="modern"] .cmod-row:last-child { border-bottom: 0; }
body[data-theme="modern"] .cmod-row-k {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
body[data-theme="modern"] .cmod-row-k svg { color: var(--muted); }

body[data-theme="modern"] .cmod-select {
  font: inherit !important;
  font-size: 13px !important;
  padding: 7px 10px !important;
  border-radius: 7px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  cursor: pointer !important;
  outline: none !important;
  min-width: 200px;
}
body[data-theme="modern"] .cmod-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

body[data-theme="modern"] .cmod-people {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
body[data-theme="modern"] .cmod-person {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 3px;
  border-radius: 99px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  transition: all 0.12s;
}
body[data-theme="modern"] .cmod-person:hover {
  background: var(--surface-2);
}
body[data-theme="modern"] .cmod-person.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}
body[data-theme="modern"] .cmod-person-av {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

body[data-theme="modern"] .cmod-quick,
body[data-theme="modern"] .cmod-prio,
body[data-theme="modern"] .cmod-est {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
body[data-theme="modern"] .cmod-quick-btn,
body[data-theme="modern"] .cmod-prio-btn,
body[data-theme="modern"] .cmod-est-btn {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
body[data-theme="modern"] .cmod-quick-btn:hover,
body[data-theme="modern"] .cmod-prio-btn:hover,
body[data-theme="modern"] .cmod-est-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
body[data-theme="modern"] .cmod-quick-btn.active,
body[data-theme="modern"] .cmod-est-btn.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
body[data-theme="modern"] .cmod-prio-btn.active[data-prio="basse"] {
  background: rgba(21, 128, 61, 0.12);
  color: var(--success);
  border-color: rgba(21, 128, 61, 0.35);
}
body[data-theme="modern"] .cmod-prio-btn.active[data-prio="moyenne"] {
  background: rgba(180, 83, 9, 0.12);
  color: var(--warning);
  border-color: rgba(180, 83, 9, 0.35);
}
body[data-theme="modern"] .cmod-prio-btn.active[data-prio="haute"] {
  background: rgba(185, 28, 28, 0.12);
  color: var(--danger);
  border-color: rgba(185, 28, 28, 0.35);
}

body[data-theme="modern"] .cmod-date {
  font: inherit !important;
  font-size: 12.5px !important;
  padding: 5px 10px !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  background: var(--surface) !important;
  color: var(--ink-2) !important;
  outline: none !important;
  font-family: "JetBrains Mono", ui-monospace, monospace !important;
  margin-left: 4px;
}
body[data-theme="modern"] .cmod-date:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

body[data-theme="modern"] .cmod-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
body[data-theme="modern"] .cmod-foot-meta {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
body[data-theme="modern"] .cmod-foot-meta .kbd {
  margin-right: 0;
}

/* Mobile : modal full-screen */
@media (max-width: 700px) {
  body[data-theme="modern"] .cmod-overlay { padding: 0; align-items: stretch; }
  body[data-theme="modern"] .cmod {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  body[data-theme="modern"] .cmod-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}


/* ================================================================== */
/* 53. Settings pages (space-settings §15 + ws-settings §16)            */
/* ================================================================== */
body[data-theme="modern"] .ss-pane { animation: view-in 0.2s var(--ease) both; }

/* Toggle switch — robuste qu'il soit rendu en <div> ou en <button> */
body[data-theme="modern"] .b-toggle {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  display: inline-block;
  box-sizing: border-box;
  width: 32px;
  height: 18px;
  min-width: 32px;
  min-height: 18px; /* annule le min-height:44px (cible tactile) de mobile.css */
  border-radius: 99px;
  background: var(--surface-3);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
body[data-theme="modern"] .b-toggle span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 99px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform 0.15s var(--ease);
}
body[data-theme="modern"] .b-toggle.on { background: var(--accent); }
body[data-theme="modern"] .b-toggle.on span { transform: translateX(14px); }

/* Preference row */
body[data-theme="modern"] .pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-2);
}
body[data-theme="modern"] .pref-row:first-of-type { border-top: 0; }
body[data-theme="modern"] .pref-row strong { color: var(--ink); }

/* Form fields (settings) */
body[data-theme="modern"] .f-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}
body[data-theme="modern"] .f-input,
body[data-theme="modern"] .f-select,
body[data-theme="modern"] .f-area {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  transition: all 0.15s var(--ease);
}
body[data-theme="modern"] .f-input:focus,
body[data-theme="modern"] .f-select:focus,
body[data-theme="modern"] .f-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body[data-theme="modern"] .f-area {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}
body[data-theme="modern"] .f-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Identity row + preview */
body[data-theme="modern"] .ss-identity {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
body[data-theme="modern"] .space-create-preview {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  background: var(--c, #0891b2);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 24px;
  font-weight: 700;
  transition: background 0.2s var(--ease);
}
body[data-theme="modern"] .space-create-preview svg { width: 24px; height: 24px; }

/* Color picker */
body[data-theme="modern"] .space-color-row { display: flex; gap: 7px; flex-wrap: wrap; }
body[data-theme="modern"] .space-color {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s;
  padding: 0;
}
body[data-theme="modern"] .space-color:hover { transform: scale(1.1); }
body[data-theme="modern"] .space-color.active { border-color: var(--ink); transform: scale(1.06); }

/* Icon picker */
body[data-theme="modern"] .space-icon-row { display: flex; gap: 6px; flex-wrap: wrap; }
body[data-theme="modern"] .space-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}
body[data-theme="modern"] .space-icon:hover { border-color: var(--border-strong); }
body[data-theme="modern"] .space-icon.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
body[data-theme="modern"] .space-icon svg { width: 14px; height: 14px; }

/* Space card preview (used in settings + espaces grid) */
body[data-theme="modern"] .space-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 4px;
}
body[data-theme="modern"] .space-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
body[data-theme="modern"] .space-sub { font-size: 11.5px; color: var(--muted); }

/* Danger zone */
body[data-theme="modern"] .ss-danger {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
body[data-theme="modern"] .ss-danger-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}
body[data-theme="modern"] .ss-danger-row:first-child { border-top: 0; }
body[data-theme="modern"] .ss-danger-critical { background: rgba(185, 28, 28, 0.035); }
body[data-theme="modern"] .ss-danger-info { flex: 1; min-width: 0; }
body[data-theme="modern"] .ss-danger-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
body[data-theme="modern"] .ss-danger-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 480px;
}
body[data-theme="modern"] .ss-danger-row .btn { flex-shrink: 0; }

/* Settings grid (reuse .grid but ensure it stacks on mobile) */
@media (max-width: 1000px) {
  body[data-theme="modern"] .ss-pane .grid { grid-template-columns: 1fr; }
}

/* Space card gear button (espaces grid → space-settings) */
body[data-theme="modern"] .space-card .space-head { display: flex; align-items: center; gap: 11px; }
body[data-theme="modern"] .space-gear {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
body[data-theme="modern"] .space-card:hover .space-gear { opacity: 1; }
body[data-theme="modern"] .space-gear:hover { background: var(--surface-2); color: var(--ink); }

/* KPI clickable (dashboard navigation) */
body[data-theme="modern"] .kpi-clickable { cursor: pointer; }
body[data-theme="modern"] .kpi-clickable:hover { background: var(--surface-2); }
/* Quick-capture send arrow turns accent when there's text */
body[data-theme="modern"] .qc-send { color: var(--muted); }
body[data-theme="modern"] .qc-input:not(:placeholder-shown) ~ .qc-tools .qc-send { color: var(--accent); }

/* Group-by dropdown (Mes tâches) */
body[data-theme="modern"] .md-group-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  pointer-events: none;
  transition: all 0.15s var(--ease);
}
body[data-theme="modern"] .md-group-menu.open {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
body[data-theme="modern"] .md-group-label {
  font-size: 10px; font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.07em; padding: 4px 8px 6px;
}
body[data-theme="modern"] .md-group-opt {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 6px; border: 0; background: transparent;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-family: inherit;
  transition: background 0.12s;
}
body[data-theme="modern"] .md-group-opt:hover { background: var(--surface-2); color: var(--ink); }
body[data-theme="modern"] .md-group-opt.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }

/* ================================================================== */
/* 54. Dashboard charts grid (v4)                                       */
/* ================================================================== */
body[data-theme="modern"] .charts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
  gap: 12px;
  flex-wrap: wrap;
}
body[data-theme="modern"] .charts-title {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
body[data-theme="modern"] .charts-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}
body[data-theme="modern"] .charts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { body[data-theme="modern"] .charts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { body[data-theme="modern"] .charts-grid { grid-template-columns: 1fr; } }
body[data-theme="modern"] .ch-card { display: flex; flex-direction: column; }
body[data-theme="modern"] .ch-span-2 { grid-column: span 2; }
@media (max-width: 560px) { body[data-theme="modern"] .ch-span-2 { grid-column: span 1; } }
body[data-theme="modern"] .ch-body { padding: 4px 16px 16px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
body[data-theme="modern"] .ch-empty { color: var(--dim); font-size: 12px; text-align: center; padding: 20px 0; }

/* Velocity bars */
body[data-theme="modern"] .ch-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 110px;
  padding-top: 6px;
}
body[data-theme="modern"] .ch-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
body[data-theme="modern"] .ch-bar-fill {
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #60a5fa);
  transition: height 0.5s var(--ease);
  min-height: 2px;
}

/* Donut */
body[data-theme="modern"] .ch-donut-wrap { display: flex; align-items: center; gap: 14px; }
body[data-theme="modern"] .ch-legend { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
body[data-theme="modern"] .ch-leg-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
body[data-theme="modern"] .ch-leg-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
body[data-theme="modern"] .ch-leg-val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }

/* Gauge */
body[data-theme="modern"] .ch-gauge-wrap { position: relative; display: grid; place-items: center; }
body[data-theme="modern"] .ch-gauge-wrap svg path { transition: stroke-dashoffset 0.7s var(--ease); }
body[data-theme="modern"] .ch-gauge-val {
  position: absolute;
  bottom: 4px;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
body[data-theme="modern"] .ch-gauge-val span { font-size: 14px; color: var(--muted); }

/* Horizontal bars */
body[data-theme="modern"] .ch-hbars { display: flex; flex-direction: column; gap: 8px; }
body[data-theme="modern"] .ch-hbar-row { display: grid; grid-template-columns: 80px 1fr 28px; align-items: center; gap: 8px; }
body[data-theme="modern"] .ch-hbar-label { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-theme="modern"] .ch-hbar-track { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
body[data-theme="modern"] .ch-hbar-fill { height: 100%; border-radius: 99px; transition: width 0.5s var(--ease); }
body[data-theme="modern"] .ch-hbar-val { font-size: 11px; color: var(--muted); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* Range menu (shared) */
body[data-theme="modern"] .range-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 4px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  pointer-events: none;
  transition: all 0.15s var(--ease);
}
body[data-theme="modern"] .range-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
body[data-theme="modern"] .range-opt {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 6px; border: 0; background: transparent;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-family: inherit;
}
body[data-theme="modern"] .range-opt:hover { background: var(--surface-2); color: var(--ink); }
body[data-theme="modern"] .range-opt.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }

/* Customize panel */
body[data-theme="modern"] .charts-panel {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  padding: 14px;
  z-index: 60;
  display: none;
}
body[data-theme="modern"] .charts-panel.open { display: block; }
body[data-theme="modern"] .charts-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
body[data-theme="modern"] .charts-panel-title { font-weight: 700; font-size: 12.5px; color: var(--ink); }
body[data-theme="modern"] .charts-panel-foot { margin-top: 10px; }
body[data-theme="modern"] .chp-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 6px; cursor: default;
}
body[data-theme="modern"] .chp-row:hover { background: var(--surface-2); }
body[data-theme="modern"] .chp-grip { color: var(--dim); cursor: grab; display: grid; place-items: center; }
body[data-theme="modern"] .chp-name { flex: 1; font-size: 12.5px; color: var(--ink-2); }

/* ================================================================== */
/* 55. Personnaliser le tableau de bord (panneau KPI latéral)          */
/* ================================================================== */
body[data-theme="modern"] .kpi-panel-backdrop {
  position: fixed; inset: 0; background: rgba(10, 10, 10, 0.28);
  opacity: 0; visibility: hidden; transition: opacity 0.2s var(--ease); z-index: 1200;
}
body[data-theme="modern"] .kpi-panel-backdrop.open { opacity: 1; visibility: visible; }
body[data-theme="modern"] .kpi-panel {
  position: fixed; top: 0; right: 0; height: 100%; width: 384px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(10, 10, 10, 0.10);
  transform: translateX(100%); transition: transform 0.24s var(--ease);
  z-index: 1201; display: flex; flex-direction: column;
}
body[data-theme="modern"] .kpi-panel.open { transform: translateX(0); }
body[data-theme="modern"] .kpi-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 20px 0;
}
body[data-theme="modern"] .kpi-panel-title {
  font-family: "Inter Tight", "Inter", sans-serif; font-size: 17px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.01em;
}
body[data-theme="modern"] .kpi-panel-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
body[data-theme="modern"] .kpi-panel-help { padding: 14px 20px 6px; font-size: 12px; color: var(--dim); }
body[data-theme="modern"] .kpi-panel-body { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
body[data-theme="modern"] .kpi-opt {
  display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 10px;
  transition: background 0.15s var(--ease);
}
body[data-theme="modern"] .kpi-opt:hover { background: var(--surface-2); }
body[data-theme="modern"] .kpi-opt.dragging { opacity: 0.5; }
body[data-theme="modern"] .kpi-opt.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
body[data-theme="modern"] .kpi-opt-grip { cursor: grab; color: var(--dim); display: grid; place-items: center; flex-shrink: 0; }
body[data-theme="modern"] .kpi-opt-grip svg { width: 15px; height: 15px; }
body[data-theme="modern"] .kpi-opt-ico {
  width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2);
  color: var(--muted); display: grid; place-items: center; flex-shrink: 0;
}
body[data-theme="modern"] .kpi-opt-ico svg { width: 15px; height: 15px; }
body[data-theme="modern"] .kpi-opt-meta { flex: 1; min-width: 0; }
body[data-theme="modern"] .kpi-opt-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
body[data-theme="modern"] .kpi-opt-val {
  font-size: 12px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body[data-theme="modern"] .kpi-opt.off .kpi-opt-name,
body[data-theme="modern"] .kpi-opt.off .kpi-opt-ico { opacity: 0.55; }
body[data-theme="modern"] .kpi-panel-foot {
  display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border);
}
body[data-theme="modern"] .kpi-panel-foot .btn { flex: 1; justify-content: center; }
body[data-theme="modern"] .cfg-badge {
  display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 20px;
  background: var(--surface-3); color: var(--muted); font-size: 10.5px; font-weight: 600;
  vertical-align: middle; letter-spacing: 0;
}

/* ---- Dashboard : Filtrer (popover) + Partager (toast) ---- */
body[data-theme="modern"] .dbf-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--dim); padding: 6px 10px 3px;
}
body[data-theme="modern"] .dbf-sep { height: 1px; background: var(--border); margin: 5px 0; }
body[data-theme="modern"] .db-filter-badge {
  place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 5px;
  border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
}
body[data-theme="modern"] .db-toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--surface);
  padding: 9px 16px; border-radius: 8px; font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-pop); z-index: 2000; opacity: 0; pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); max-width: 80vw;
}
body[data-theme="modern"] .db-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Dashboard charts : nouveaux types (line / throughput / cycle / upcoming) ---- */
body[data-theme="modern"] .ch-line-wrap { width: 100%; height: 110px; padding-top: 4px; }
body[data-theme="modern"] .ch-line { width: 100%; height: 100%; display: block; overflow: visible; }

/* Throughput : barres groupées créées vs terminées */
body[data-theme="modern"] .ch-tp {
  display: flex; align-items: flex-end; gap: 6px; height: 100px; padding-top: 6px;
}
body[data-theme="modern"] .ch-tp-col { flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 2px; }
body[data-theme="modern"] .ch-tp-bar { flex: 1; border-radius: 3px 3px 1px 1px; min-height: 2px; transition: height 0.5s var(--ease); }
body[data-theme="modern"] .ch-tp-bar.c { background: var(--surface-3); }
body[data-theme="modern"] .ch-tp-bar.d { background: linear-gradient(180deg, var(--success), #34d399); }
body[data-theme="modern"] .ch-tp-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted); }
body[data-theme="modern"] .ch-tp-legend span { display: inline-flex; align-items: center; gap: 5px; }
body[data-theme="modern"] .ch-tp-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
body[data-theme="modern"] .ch-tp-dot.c { background: var(--surface-3); }
body[data-theme="modern"] .ch-tp-dot.d { background: var(--success); }

/* Cycle time : grand nombre + distribution */
body[data-theme="modern"] .ch-cycle { display: flex; flex-direction: column; gap: 12px; }
body[data-theme="modern"] .ch-cycle-big {
  font-family: "Inter Tight", "Inter", sans-serif; font-size: 34px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.03em; line-height: 1;
}
body[data-theme="modern"] .ch-cycle-big span { font-size: 16px; color: var(--muted); margin-left: 2px; }

/* Barres avec libellé d'axe (échéances à venir) */
body[data-theme="modern"] .ch-bars-labeled { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 6px; }
body[data-theme="modern"] .ch-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
body[data-theme="modern"] .ch-bar-stack { flex: 1; width: 100%; display: flex; align-items: flex-end; }
body[data-theme="modern"] .ch-bar-col .ch-bar-fill {
  width: 100%; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #60a5fa);
  transition: height 0.5s var(--ease); min-height: 2px;
}
body[data-theme="modern"] .ch-bar-x { font-size: 10px; color: var(--dim); font-weight: 600; }

/* ---- Dashboard : menu Partager (popover) ---- */
body[data-theme="modern"] .share-pop {
  position: absolute; top: calc(100% + 6px); right: 0; width: 360px; max-width: 90vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(10,10,10,.04), 0 16px 44px rgba(10,10,10,.14);
  padding: 16px; z-index: 1100;
  opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: all .15s var(--ease);
}
body[data-theme="modern"] .share-pop.open { opacity: 1; transform: none; pointer-events: auto; }
body[data-theme="modern"] .share-pop-title { font-family: "Inter Tight","Inter",sans-serif; font-size: 15px; font-weight: 700; color: var(--ink); }
body[data-theme="modern"] .share-pop-sub { font-size: 12px; color: var(--muted); margin: 2px 0 12px; }
body[data-theme="modern"] .share-invite { display: flex; gap: 6px; margin-bottom: 12px; }
body[data-theme="modern"] .share-input { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: var(--ink); font-family: inherit; outline: none; }
body[data-theme="modern"] .share-input:focus { border-color: var(--accent); }
body[data-theme="modern"] .share-role { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; font-size: 12px; color: var(--ink-2); font-family: inherit; cursor: pointer; }
body[data-theme="modern"] .share-invite .btn { padding: 7px 12px; }
body[data-theme="modern"] .share-members { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
body[data-theme="modern"] .share-mem { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
body[data-theme="modern"] .share-mem-av { width: 30px; height: 30px; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
body[data-theme="modern"] .share-mem-meta { flex: 1; min-width: 0; }
body[data-theme="modern"] .share-mem-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-theme="modern"] .share-mem-email { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-theme="modern"] .share-mem-role { font-size: 12px; color: var(--muted); flex-shrink: 0; }
body[data-theme="modern"] .share-empty { font-size: 12.5px; color: var(--muted); padding: 12px 4px; text-align: center; }
body[data-theme="modern"] .share-general { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; }
body[data-theme="modern"] .share-general-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
body[data-theme="modern"] .share-general-l svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
body[data-theme="modern"] .share-general-t { font-size: 13px; font-weight: 600; color: var(--ink); }
body[data-theme="modern"] .share-general-s { font-size: 11.5px; color: var(--muted); }
body[data-theme="modern"] .share-foot { display: flex; gap: 8px; }
body[data-theme="modern"] .share-foot .btn { flex: 1; justify-content: center; }

/* ================================================================== */
/* 56. Dashboard — vue Tableau (Kanban global)                         */
/* ================================================================== */
body[data-theme="modern"] .board-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 4px 0 16px; flex-wrap: wrap;
}
body[data-theme="modern"] .board-groupby { display: flex; align-items: center; gap: 6px; }
body[data-theme="modern"] .board-groupby-label { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-right: 4px; }
body[data-theme="modern"] .board-gb-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  font-family: inherit; transition: all 0.15s var(--ease);
}
body[data-theme="modern"] .board-gb-btn:hover { background: var(--surface-2); }
body[data-theme="modern"] .board-gb-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
body[data-theme="modern"] .board-count { font-size: 12.5px; color: var(--muted); }
body[data-theme="modern"] .board-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start;
}
body[data-theme="modern"] .board-empty { color: var(--muted); font-size: 13px; padding: 40px; text-align: center; }
body[data-theme="modern"] .bcol {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; min-width: 0;
}
body[data-theme="modern"] .bcol-head { display: flex; align-items: center; gap: 7px; padding: 2px 4px 10px; }
body[data-theme="modern"] .bcol-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
body[data-theme="modern"] .bcol-label { font-size: 12.5px; font-weight: 600; color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-theme="modern"] .bcol-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
body[data-theme="modern"] .bcol-body { display: flex; flex-direction: column; gap: 8px; }
body[data-theme="modern"] .bcol-empty { color: var(--dim); font-size: 12px; text-align: center; padding: 10px 0; }
body[data-theme="modern"] .bcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; cursor: pointer; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
body[data-theme="modern"] .bcard:hover { border-color: var(--border-hover); box-shadow: 0 1px 2px rgba(10,10,10,.04), 0 6px 18px rgba(10,10,10,.06); }
body[data-theme="modern"] .bcard-ctx { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: none; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-theme="modern"] .bcard-title { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.35; }
body[data-theme="modern"] .bcard-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
body[data-theme="modern"] .bcard-spacer { flex: 1; }
body[data-theme="modern"] .bcard-pri { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; text-transform: lowercase; }
body[data-theme="modern"] .bcard-pri.haute { background: rgba(220,38,38,.1); color: var(--danger); }
body[data-theme="modern"] .bcard-pri.moyenne { background: rgba(217,119,6,.12); color: var(--warning); }
body[data-theme="modern"] .bcard-pri.basse { background: rgba(22,163,74,.1); color: var(--success); }
body[data-theme="modern"] .bcard-due { font-size: 11px; color: var(--muted); }
body[data-theme="modern"] .bcard-due.late { color: var(--danger); font-weight: 600; }
body[data-theme="modern"] .bcard-av { width: 22px; height: 22px; border-radius: 6px; color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }

/* ------------------------------------------------------------------ */
/* MODE SOMBRE — variante « modernDark » du design Modern.             */
/* Même design system, palette inversée : on ne surcharge QUE les      */
/* variables ; toutes les règles modern s'appliquent telles quelles.   */
/* Activé via body[data-mode="dark"] (compte = theme "modernDark").    */
/* ------------------------------------------------------------------ */
body[data-theme="modern"][data-mode="dark"] {
  color-scheme: dark;

  --ink: #fafafa;
  --ink-2: #e4e4e7;
  --surface-2: #232327;
  --surface-3: #2a2a30;
  --border-strong: #3a3a42;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-border: #2c4a8a;

  --bg: #121214;
  --surface: #1c1c20;
  --surface2: #232327;
  --surface3: #2a2a30;
  --border: #2c2c33;
  --border-hover: #3a3a42;

  --text: #fafafa;
  --muted: #a5a5ae;
  --dim: #74747e;
  --text-muted: #a5a5ae;
  --text-dim: #74747e;

  --accent: #3b82f6;
  --accent2: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.22);

  /* Sémantiques : mêmes valeurs qu'iOS (constantes sur les deux modes) */
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;

  /* cardShadow iOS sombre : noir à 45 % */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.45);
}
/* Fond graphique — port de OrionBackgroundView (iOS, mode sombre) :
   halo accent en haut-droite (.18), halo violet en bas-gauche (.10),
   pastille accent diffuse hors-écran (.16) + léger voile clair en haut (.04). */
body[data-theme="modern"][data-mode="dark"] {
  background:
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(59, 130, 246, 0.13), transparent 60%),
    radial-gradient(ellipse 50% 38% at 0% 100%, rgba(124, 58, 237, 0.08), transparent 60%),
    var(--bg) !important;
  background-attachment: fixed;
}
/* Les grands conteneurs pleine page restent transparents pour laisser voir les halos. */
body[data-theme="modern"][data-mode="dark"] .content,
body[data-theme="modern"][data-mode="dark"] main {
  background: transparent;
}
/* Sidebar translucide en sombre : laisse transparaître le halo violet
   bas-gauche du fond graphique (cf. OrionBackgroundView iOS). */
body[data-theme="modern"][data-mode="dark"] aside.sidebar {
  background: rgba(18, 18, 20, 0.55);
}
/* Ajustements ciblés : éléments qui codaient du clair en dur. */
body[data-theme="modern"][data-mode="dark"] .view-tab.active {
  background: var(--ink) !important;
  color: #121214 !important;
}
/* Boutons « pilule encre » : en sombre, l'encre devient blanche alors que leur
   texte est #fff codé en dur → on les bascule sur l'accent (lisible, comme iOS). */
body[data-theme="modern"][data-mode="dark"] .btn.main,
body[data-theme="modern"][data-mode="dark"] .btn.primary,
body[data-theme="modern"][data-mode="dark"] .new-btn,
body[data-theme="modern"][data-mode="dark"] main .btn-new,
body[data-theme="modern"][data-mode="dark"] .btn-new,
body[data-theme="modern"][data-mode="dark"] .btn-new-space,
body[data-theme="modern"][data-mode="dark"] .board-gb-btn.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
body[data-theme="modern"][data-mode="dark"] .btn.main:hover,
body[data-theme="modern"][data-mode="dark"] .btn.primary:hover,
body[data-theme="modern"][data-mode="dark"] .new-btn:hover,
body[data-theme="modern"][data-mode="dark"] main .btn-new:hover,
body[data-theme="modern"][data-mode="dark"] .btn-new:hover,
body[data-theme="modern"][data-mode="dark"] .btn-new-space:hover {
  background: var(--accent2) !important;
  border-color: var(--accent2) !important;
}
/* Pastilles logo (carré encre + glyphe blanc) : accent en sombre. */
body[data-theme="modern"][data-mode="dark"] .ws-mark,
body[data-theme="modern"][data-mode="dark"] .ws-item .ws-mark {
  background: var(--accent);
  color: #fff;
}
body[data-theme="modern"][data-mode="dark"] img,
body[data-theme="modern"][data-mode="dark"] .docs-card-cover {
  filter: none; /* pas d'inversion d'images */
}
body[data-theme="modern"][data-mode="dark"] ::-webkit-scrollbar-thumb {
  background: #3a3a42;
}
