/* ================================================================== */
/*  Isa-Pilot — feuille de styles                                      */
/* ================================================================== */

:root {
  --bg: #f4f7fb;
  --bg-accent: radial-gradient(1200px 600px at 85% -10%, rgba(0, 86, 164, 0.10), transparent 60%),
               radial-gradient(900px 500px at -10% 10%, rgba(14, 165, 233, 0.07), transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf2f8;
  --sidebar: #ffffff;
  --text: #171a2b;
  --text-soft: #555b70;
  --muted: #8b90a4;
  --border: #e3e8f0;
  --border-strong: #d2dae6;
  --primary: #0056a4;
  --primary-hover: #00457f;
  --primary-soft: #e5f0fa;
  --primary-contrast: #ffffff;
  --accent-blue: #1f6fae;
  --success: #0e9f72;
  --success-soft: #e4f7f0;
  --warning: #c2740a;
  --warning-soft: #fdf1d8;
  --danger: #d33838;
  --danger-soft: #fdeaea;
  --info: #0478b9;
  --info-soft: #e3f3fd;
  --brand-gradient: linear-gradient(135deg, #00345f 0%, #0056a4 52%, #2377ba 100%);
  --shadow-xs: 0 1px 2px rgba(20, 26, 52, 0.05);
  --shadow-sm: 0 2px 8px -4px rgba(20, 26, 52, 0.12);
  --shadow-md: 0 14px 32px -18px rgba(20, 26, 52, 0.24);
  --shadow-lg: 0 32px 72px -32px rgba(20, 26, 52, 0.38);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --sidebar-width: 268px;
  --topbar-height: 68px;
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
  --transition: 160ms cubic-bezier(0.2, 0.7, 0.3, 1);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
  /* Design system minimal : espacements, contrôles et rayons */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --control-sm: 32px;
  --control-md: 38px;
  --control-lg: 44px;
  --control-field: 40px;
  --radius-control-sm: 8px;
  --radius-control: 10px;
}

[data-theme="dark"] {
  --bg: #0a111b;
  --bg-accent: radial-gradient(1100px 560px at 88% -10%, rgba(0, 86, 164, 0.18), transparent 60%),
               radial-gradient(900px 500px at -8% 8%, rgba(56, 189, 248, 0.07), transparent 55%);
  --surface: #111b27;
  --surface-2: #162230;
  --surface-3: #1e2e40;
  --sidebar: #0c1621;
  --text: #eef0f8;
  --text-soft: #b7bdd1;
  --muted: #7f879f;
  --border: #233245;
  --border-strong: #33475f;
  --primary: #6db7ef;
  --primary-hover: #8cc9f5;
  --primary-soft: #102a42;
  --primary-contrast: #07131f;
  --accent-blue: #7cc0f0;
  --success: #34d399;
  --success-soft: #102a24;
  --warning: #fbbf24;
  --warning-soft: #2d2412;
  --danger: #f87171;
  --danger-soft: #2e1618;
  --info: #38bdf8;
  --info-soft: #102533;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px -4px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -36px rgba(0, 0, 0, 0.85);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  background-image: var(--bg-accent);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
mark { background: rgba(250, 204, 21, 0.35); color: inherit; border-radius: 3px; padding: 0 1px; }
[data-theme="dark"] mark { background: rgba(250, 204, 21, 0.28); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

.icon { flex: none; display: inline-block; vertical-align: -0.18em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.divider { height: 1px; background: var(--border); border: 0; margin: 18px 0; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ================================================================== */
/*  Écran de démarrage                                                 */
/* ================================================================== */

.app-root { min-height: 100vh; }

.boot-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.boot-logo {
  width: 58px; height: 58px; border-radius: 17px; color: #fff;
  background-image: radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.28), transparent 56%), var(--brand-gradient);
  border: 1px solid rgba(255, 255, 255, 0.20);
  display: grid; place-items: center;
  box-shadow: 0 18px 34px -18px rgba(0, 86, 164, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.30);
}
.boot-spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 8px;
}
.spinner-sm { width: 13px; height: 13px; border-width: 1.7px; margin-right: 6px; }

/* ================================================================== */
/*  Connexion / 2FA                                                    */
/* ================================================================== */

.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 0.9fr) 1.1fr;
  background: var(--bg);
}
.auth-visual {
  position: relative; overflow: hidden; padding: 54px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, #002c52 0%, #0056a4 48%, #2377ba 100%);
  color: #fff;
}
.auth-visual::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 62%); top: -180px; right: -160px;
}
.auth-visual::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.20), transparent 65%); bottom: -160px; left: -120px;
}
.auth-brand { position: relative; display: flex; align-items: center; gap: 14px; }
.auth-brand-mark {
  width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,0.16); backdrop-filter: blur(8px);
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.26); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 12px 26px -18px rgba(0, 0, 0, 0.65);
}
.auth-brand-name { font-size: 20px; font-weight: 750; letter-spacing: -0.2px; }
.auth-brand-sub { font-size: 12.5px; color: rgba(255,255,255,0.72); margin-top: 1px; }
.auth-pitch { position: relative; max-width: 460px; margin: 40px 0; }
.auth-pitch h1 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; letter-spacing: -1.1px; font-weight: 760; }
.auth-pitch h1 span { color: #cfe6fb; }
.auth-pitch p { margin-top: 16px; color: rgba(255,255,255,0.8); font-size: 15.5px; max-width: 400px; }
.auth-features { position: relative; display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; }
.auth-feature-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.16);
}
.auth-feature strong { display: block; font-size: 13.5px; font-weight: 650; }
.auth-feature span { font-size: 12.5px; color: rgba(255,255,255,0.7); }
.auth-visual-foot { position: relative; font-size: 12px; color: rgba(255,255,255,0.55); display: flex; gap: 18px; flex-wrap: wrap; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card-head h2 { font-size: 27px; letter-spacing: -0.6px; font-weight: 720; }
.auth-card-head p { margin-top: 6px; color: var(--text-soft); font-size: 14px; }
.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn-primary { margin-top: 6px; }
.auth-alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger); font-size: 13px; border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
}
.auth-alert.is-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.auth-help { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 22px; line-height: 1.6; }
.auth-help a, .link-btn { color: var(--primary); font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

.otp-input {
  letter-spacing: 0.55em; text-align: center; font-size: 24px; font-weight: 650; font-family: var(--font-mono);
  padding-left: 0.55em;
}
.qr-box {
  display: flex; gap: 20px; align-items: center; background: var(--surface-2); border: 1px solid var(--border);
  padding: 18px; border-radius: var(--radius);
}
.qr-box img { width: 148px; height: 148px; border-radius: 10px; background: #fff; padding: 6px; }
.secret-box {
  display: flex; align-items: center; gap: 8px; background: var(--surface-3); border-radius: var(--radius-xs);
  padding: 8px 10px; font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; margin-top: 8px;
}
.secret-box button { margin-left: auto; }
.steps-mini { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.step-dot.is-active { background: var(--primary); width: 22px; border-radius: 5px; }
.step-dot.is-done { background: var(--success); }

/* ================================================================== */
/*  Structure de l'application                                         */
/* ================================================================== */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width); flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40;
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 20px 14px 16px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; color: #fff;
  background-image: radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.30), transparent 56%), var(--brand-gradient);
  border: 1px solid rgba(255, 255, 255, 0.20);
  display: grid; place-items: center; flex: none;
  box-shadow: 0 10px 20px -12px rgba(0, 86, 164, 0.90), inset 0 1px 0 rgba(255, 255, 255, 0.30);
}
.brand-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-weight: 760; font-size: 16.5px; letter-spacing: -0.3px; line-height: 1.15; display: block; }
.brand-sub { font-size: 10.8px; color: var(--muted); letter-spacing: 0.015em; line-height: 1.4; margin-top: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; }
.nav-label {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding: 16px 12px 7px; font-weight: 650;
}
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-soft);
  font-size: 13.5px; font-weight: 520; transition: background var(--transition), color var(--transition);
  position: relative; line-height: 1.3;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 640; }
.nav-link.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-link .icon { opacity: 0.9; }
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700; min-width: 20px; text-align: center;
  background: var(--surface-3); color: var(--text-soft); border-radius: 20px; padding: 1px 6px;
}
.nav-link.is-active .nav-badge { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.nav-badge.is-alert { background: var(--danger-soft); color: var(--danger); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-height); position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(14px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-title { font-size: 14px; font-weight: 650; color: var(--text-soft); letter-spacing: -0.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.mobile-toggle { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 10px 0 12px; min-width: 220px;
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; color: var(--muted); font-size: 13px;
  transition: border-color var(--transition), background var(--transition);
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface); }
.search-trigger .kbd { margin-left: auto; }
.kbd {
  font-family: var(--font-mono); font-size: 10.5px; padding: 2px 5px; border-radius: 5px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); line-height: 1.4;
}
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-soft); transition: background var(--transition), color var(--transition); position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .badge-dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
  border: 2px solid var(--surface);
}

.page { width: 100%; max-width: 1480px; margin: 0 auto; padding: 30px 32px 72px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head-text { min-width: 0; }
.eyebrow { font-size: 11px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--primary); font-weight: 700; margin-bottom: 6px; }
.page-head h1 { font-size: clamp(25px, 2.4vw, 32px); letter-spacing: -0.8px; font-weight: 740; line-height: 1.15; }
.page-sub { color: var(--text-soft); margin-top: 7px; font-size: 14px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.page-section { margin-top: 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font-size: 16.5px; font-weight: 680; letter-spacing: -0.2px; }
.section-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.section-action { display: flex; gap: 8px; align-items: center; }

/* ================================================================== */
/*  Boutons                                                            */
/* ================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-md); padding: 0 var(--space-4);
  border-radius: var(--radius-control); border: 1px solid transparent; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  line-height: 1; user-select: none;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: 0 8px 18px -12px rgba(0, 86, 164, 0.9); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 22px -12px rgba(0, 86, 164, 1); }
[data-theme="dark"] .btn-primary { color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--muted); background: var(--surface-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-sm { height: var(--control-sm); padding: 0 var(--space-3); font-size: 12.5px; border-radius: var(--radius-control-sm); gap: 5px; }
.btn-lg { height: var(--control-lg); padding: 0 var(--space-5); font-size: 14.5px; border-radius: var(--radius-control); }
.btn-block { width: 100%; }
.btn-icon { width: var(--control-md); height: var(--control-md); padding: 0; }
.btn-icon.btn-sm { width: var(--control-sm); height: var(--control-sm); }
.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.btn-group .btn { border-radius: 0; height: 34px; }
.btn-group .btn + .btn { border-left: 1px solid var(--border); }
.btn-group .btn.is-active { background: var(--primary-soft); color: var(--primary); }

/* ================================================================== */
/*  Formulaires                                                        */
/* ================================================================== */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 620; color: var(--text-soft); }
.field-label em { color: var(--danger); font-style: normal; }
.field-hint { font-size: 11.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--radius-control); padding: 9px var(--space-3); font-size: 13.5px; transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  min-height: var(--control-field);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b90a4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input-sm, .select-sm { height: 34px; min-height: 34px; padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 38px; }
.input-group > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-group .input-action { position: absolute; right: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-grid .span-2 { grid-column: span 2; }
.form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: 12.5px; min-height: 0; }
.form-note { font-size: 12px; color: var(--muted); }
input[type="date"], input[type="datetime-local"], input[type="time"] { color-scheme: light; }
[data-theme="dark"] input[type="date"], [data-theme="dark"] input[type="datetime-local"], [data-theme="dark"] input[type="time"] { color-scheme: dark; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer;
}
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text strong { font-size: 13.5px; font-weight: 620; }
.switch-text small { font-size: 12px; color: var(--muted); }
.switch { position: relative; flex: none; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 2; }
.switch-track {
  position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong);
  transition: background var(--transition);
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform var(--transition);
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

/* ================================================================== */
/*  Cartes, badges, tags, avatars                                      */
/* ================================================================== */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14.5px; font-weight: 670; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-hover { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2.5px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 650; line-height: 1.5; white-space: nowrap; letter-spacing: 0.01em;
  background: var(--surface-3); color: var(--text-soft);
}
.badge-neutral { background: var(--surface-3); color: var(--text-soft); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-indigo { background: var(--primary-soft); color: var(--primary); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); font-size: 11.5px; font-weight: 520;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-project { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 20%, transparent); background: var(--primary-soft); }
.tag-audio { color: var(--accent-blue); }

.avatar {
  width: var(--avatar-size, 32px); height: var(--avatar-size, 32px); border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; background: var(--avatar-bg, var(--primary)); color: #fff;
  font-size: calc(var(--avatar-size, 32px) * 0.36); font-weight: 700; letter-spacing: 0.02em;
  border: 2px solid var(--surface); text-transform: uppercase;
}
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-more { background: var(--surface-3); color: var(--text-soft); font-size: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-soft); }

.person-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px;
}
.person-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot-color, var(--primary)); }
.person-remove { border: 0; background: none; color: var(--muted); font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
.person-remove:hover { color: var(--danger); }

/* ================================================================== */
/*  Progression                                                        */
/* ================================================================== */

.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--bar-color, var(--primary)); transition: width 0.5s ease; }
.progress-thin { height: 5px; }
.ring-wrap { position: relative; width: var(--ring-size, 48px); height: var(--ring-size, 48px); flex: none; display: inline-grid; place-items: center; }
.ring { display: block; }
.ring-track { stroke: var(--surface-3); }
.ring-value { transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.7, 0.3, 1); }
.ring-label { position: absolute; font-size: calc(var(--ring-size, 48px) * 0.24); font-weight: 720; letter-spacing: -0.3px; }
.ring-label small { font-size: 60%; font-weight: 600; color: var(--muted); margin-left: 1px; }

/* ================================================================== */
/*  Cartes projet                                                      */
/* ================================================================== */

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 16px; }
.project-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.project-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent, var(--primary)); }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-kind {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
.project-card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-card-title-row h3 { flex: 1; min-width: 0; }
.project-progress-pct { flex: none; padding: 2px 8px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; }
.project-card h3 { font-size: 16px; font-weight: 690; letter-spacing: -0.25px; line-height: 1.3; }
.project-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.project-owner { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-owner .avatar { border-color: var(--surface); }
.project-updated { display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; }
.project-client { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.project-progress { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.project-progress-info { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.project-progress-info strong { color: var(--text); font-size: 13px; }
.project-next { display: inline-flex; align-items: center; gap: 4px; color: var(--text-soft); }
.project-next.is-overdue { color: var(--danger); font-weight: 600; }
.project-alert {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--danger); font-weight: 600;
  background: var(--danger-soft); border-radius: 6px; padding: 4px 8px; align-self: flex-start; margin-top: 2px;
}

/* ================================================================== */
/*  Cartes note                                                        */
/* ================================================================== */

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.note-card {
  display: flex; flex-direction: column; gap: 9px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 18px; min-height: 196px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.note-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-type {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary);
  background: var(--primary-soft); border-radius: 5px; padding: 2px 7px;
}
.note-date { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.note-card h3 { font-size: 15px; font-weight: 660; letter-spacing: -0.15px; line-height: 1.35; }
.note-excerpt { font-size: 12.5px; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.note-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.note-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.note-foot-right { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); }
.foot-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; }
.foot-reminder { color: var(--warning); font-weight: 600; }

/* ================================================================== */
/*  Tâches                                                             */
/* ================================================================== */

.task-list { display: flex; flex-direction: column; }
.task-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); border-radius: 8px; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check {
  width: 21px; height: 21px; border-radius: 7px; border: 1.7px solid var(--border-strong); background: var(--surface);
  display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; flex: none;
  margin-top: 1px; color: #fff; transition: all var(--transition);
}
.task-check .icon { display: block; vertical-align: 0; }
.task-check:hover { border-color: var(--success); }
.task-row.is-done .task-check { background: var(--success); border-color: var(--success); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.task-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title { font-size: 13.5px; font-weight: 550; }
.task-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.task-project { display: inline-flex; align-items: center; gap: 5px; color: var(--text-soft); }
.task-project::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--primary)); }
.task-person { display: inline-flex; align-items: center; gap: 5px; }
.task-note { display: inline-flex; align-items: center; gap: 4px; }
.task-side { display: flex; align-items: center; gap: 8px; flex: none; }
.task-due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.task-due.is-overdue { color: var(--danger); font-weight: 650; }

/* ================================================================== */
/*  Agenda                                                             */
/* ================================================================== */

.agenda-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  border: 1px solid transparent; transition: background var(--transition), border-color var(--transition);
}
.agenda-item:hover { background: var(--surface-2); border-color: var(--border); }
.agenda-time { width: 46px; flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.agenda-time em { font-style: normal; font-size: 10.5px; }
.agenda-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--primary)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--primary)) 18%, transparent); }
.agenda-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.agenda-title { font-size: 13px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-sub { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.agenda-task .agenda-dot { background: var(--primary); }
.agenda-reminder .agenda-dot { background: var(--warning); }
.agenda-event .agenda-dot { background: var(--info); }
.agenda-milestone .agenda-dot { background: var(--accent-blue); }

.timeline-list { display: flex; flex-direction: column; gap: 4px; }
.timeline-day { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.timeline-day:last-child { border-bottom: 0; }
.timeline-date { width: 96px; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.timeline-date strong { font-size: 12.5px; }
.timeline-date span { font-size: 11px; color: var(--muted); }
.timeline-items { flex: 1; display: flex; flex-direction: column; gap: 2px; }

/* ================================================================== */
/*  Pièces jointes                                                     */
/* ================================================================== */

.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: 4px 6px 4px 4px; transition: border-color var(--transition), background var(--transition);
}
.attachment-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.attachment-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 7px 8px; }
.attachment-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.attachment-text { display: flex; flex-direction: column; min-width: 0; }
.attachment-title { font-size: 12.8px; font-weight: 570; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-meta { font-size: 11px; color: var(--muted); }
.attachment-main > .icon { color: var(--muted); flex: none; }
.attachment-delete { color: var(--muted); }
.attachment-delete:hover { color: var(--danger); }
.attachment-empty { padding: 8px 0; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--surface-2); color: var(--muted); cursor: pointer; transition: all var(--transition);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone .icon { margin-bottom: 6px; }
.dropzone strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.dropzone span { font-size: 11.5px; }

/* ================================================================== */
/*  États vides, bannières                                             */
/* ================================================================== */

.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  padding: 46px 24px; color: var(--text-soft);
}
.empty-icon {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); margin-bottom: 4px;
}
.empty-state h3 { font-size: 15px; font-weight: 660; color: var(--text); }
.empty-state p { font-size: 13px; color: var(--muted); max-width: 380px; }
.empty-action { margin-top: 10px; }

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--text-soft);
}
.banner .icon { color: var(--primary); margin-top: 1px; }
.banner strong { color: var(--text); }
.banner-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 24%, transparent); color: var(--warning); }
.banner-warning .icon { color: var(--warning); }
.banner-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 24%, transparent); color: var(--danger); }
.banner-danger .icon { color: var(--danger); }

/* ================================================================== */
/*  Toasts                                                             */
/* ================================================================== */

.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: 12px; box-shadow: var(--shadow-lg); transform: translateY(12px); opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast-icon { flex: none; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-body { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12.8px; color: var(--text-soft); min-width: 0; }
.toast-body strong { font-size: 13px; color: var(--text); }
.toast-close { border: 0; background: none; color: var(--muted); padding: 2px; flex: none; }
.toast-close:hover { color: var(--text); }

/* ================================================================== */
/*  Modales                                                            */
/* ================================================================== */

.modal-overlay {
  position: fixed; inset: 0; z-index: 150; background: rgba(10, 12, 24, 0.48); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 20px; overflow-y: auto;
  opacity: 0; transition: opacity 0.18s ease;
}
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.62); }
.modal-overlay.is-open { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); transform: translateY(10px) scale(0.985);
  transition: transform 0.18s ease; max-height: 88vh; display: flex; flex-direction: column;
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 0; }
.modal-heading h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.modal-heading p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-close { margin: -4px -6px 0 0; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px 20px; border-top: 1px solid var(--border); }
.modal-message { font-size: 14px; color: var(--text-soft); line-height: 1.6; }
.modal-message + .field { margin-top: 16px; }

/* ================================================================== */
/*  Onglets, filtres, barre d'outils                                   */
/* ================================================================== */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; border: 0; background: none;
  color: var(--muted); font-size: 13px; font-weight: 570; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color var(--transition), border-color var(--transition);
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 650; }
.tab-count { font-size: 10.5px; background: var(--surface-3); border-radius: 20px; padding: 0 6px; color: var(--text-soft); }
.tab.is-active .tab-count { background: var(--primary-soft); color: var(--primary); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.segmented button {
  border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12px; color: var(--muted); font-weight: 560;
  display: inline-flex; align-items: center; gap: 5px;
}
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.filter-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 99px; padding: 5px 11px; font-size: 12px; color: var(--text-soft); transition: all var(--transition);
}
.chip:hover { border-color: var(--border-strong); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip span { font-size: 10.5px; opacity: 0.75; }

/* ================================================================== */
/*  Tableaux                                                           */
/* ================================================================== */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted);
  font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.table-user { display: flex; align-items: center; gap: 10px; }
.table-user strong { display: block; font-size: 13px; font-weight: 620; }
.table-user > div > span { display: block; font-size: 11.5px; color: var(--muted); }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ================================================================== */
/*  Tableau de bord                                                    */
/* ================================================================== */

.dashboard-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px;
  border-radius: var(--radius-lg); background: var(--brand-gradient); color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.dashboard-hero::before {
  content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -120px; top: -200px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 65%);
}
.dashboard-hero-text { position: relative; }
.dashboard-hero h1 { font-size: 23px; font-weight: 720; letter-spacing: -0.5px; }
.dashboard-hero p { font-size: 13.5px; color: rgba(255,255,255,0.82); margin-top: 5px; max-width: 560px; }
.dashboard-hero-actions { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.btn-on-brand { background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.26); color: #fff; backdrop-filter: blur(6px); }
.btn-on-brand:hover { background: rgba(255,255,255,0.24); }
.btn-on-white { background: #fff; color: #0056a4; }
.btn-on-white:hover { background: #eaf4fc; }

.today-board {
  margin-top: 18px; overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 16%, var(--border));
  background:
    radial-gradient(700px 240px at 100% 0, color-mix(in srgb, var(--primary) 8%, transparent), transparent 72%),
    var(--surface);
}
.today-board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 19px 22px 17px; }
.today-board-intro { min-width: 0; }
.today-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.today-board-head h2 { margin-top: 4px; font-size: 22px; font-weight: 730; letter-spacing: -0.5px; }
.today-board-head p { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.today-board-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.today-board-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); border-top: 1px solid var(--border); }
.today-panel { min-width: 0; padding: 16px 22px 18px; }
.today-panel + .today-panel { border-left: 1px solid var(--border); }
.today-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.today-panel-head h3 { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.today-priority-list { display: flex; flex-direction: column; gap: 3px; }
.today-priority {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 9px;
  border: 1px solid transparent; border-left: 2px solid color-mix(in srgb, var(--accent, var(--primary)) 48%, transparent);
  transition: background var(--transition), border-color var(--transition);
}
.today-priority:hover { background: var(--surface-2); border-color: var(--border); border-left-color: var(--accent, var(--primary)); }
.today-priority-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.today-priority.is-overdue { background: color-mix(in srgb, var(--danger) 4%, transparent); }
.today-priority.is-overdue:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 20%, var(--border)); border-left-color: var(--danger); }
.today-priority.is-overdue .today-priority-icon { background: var(--danger-soft); color: var(--danger); }
.today-priority .badge { flex: none; }
.today-priority-body { flex: 1; min-width: 0; }
.today-priority-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 620; }
.today-priority-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; color: var(--muted); font-size: 11px; }
.today-priority.is-overdue .today-priority-meta { color: color-mix(in srgb, var(--danger) 78%, var(--muted)); }
.today-empty { display: flex; align-items: center; gap: 8px; padding: 24px 6px; color: var(--muted); font-size: 12px; }
.today-empty .icon { color: var(--success); flex: none; }
.today-panel + .today-panel .today-empty .icon { color: var(--muted); }
.today-agenda-list { display: flex; flex-direction: column; gap: 1px; }
.today-agenda-list .agenda-item { padding: 8px 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat-card {
  display: flex; gap: 13px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 17px; box-shadow: var(--shadow-xs); min-width: 0;
}
.stat-link { transition: transform var(--transition), box-shadow var(--transition); }
.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tone-indigo { background: var(--primary-soft); color: var(--primary); }
.tone-blue { background: color-mix(in srgb, var(--accent-blue) 14%, transparent); color: var(--accent-blue); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-amber { background: var(--warning-soft); color: var(--warning); }
.tone-red { background: var(--danger-soft); color: var(--danger); }
.tone-sky { background: var(--info-soft); color: var(--info); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 550; letter-spacing: 0.01em; }
.stat-value { font-size: 23px; font-weight: 730; letter-spacing: -0.6px; line-height: 1.15; }
.stat-hint { font-size: 11px; color: var(--muted); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.dashboard-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dashboard-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.activity-chart { display: flex; flex-direction: column; gap: 12px; }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-primary { background: var(--primary); }
.dot-success { background: var(--success); }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart-stack { display: flex; flex-direction: column-reverse; justify-content: flex-start; width: 100%; max-width: 26px; height: 100%; gap: 2px; }
.chart-bar { width: 100%; border-radius: 4px 4px 2px 2px; min-height: 0; transition: height 0.5s ease; }
.bar-notes { background: var(--primary); opacity: 0.9; }
.bar-tasks { background: var(--success); opacity: 0.85; }
.chart-label { font-size: 9.5px; color: var(--muted); text-transform: uppercase; }
.chart-value { font-size: 9.5px; color: var(--muted); height: 12px; }

.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-action {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-size: 12.5px; font-weight: 550; color: var(--text-soft); transition: all var(--transition);
}
.quick-action:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.quick-action .icon { color: var(--primary); }

.overdue-list { display: flex; flex-direction: column; gap: 2px; }
.overdue-item { display: flex; align-items: center; gap: 9px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.overdue-item:last-child { border-bottom: 0; }
.overdue-item .icon { color: var(--danger); flex: none; }
.overdue-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overdue-item small { color: var(--danger); font-size: 11px; white-space: nowrap; }

/* ================================================================== */
/*  Éditeur de note                                                    */
/* ================================================================== */

.note-action-bar {
  position: sticky; top: var(--topbar-height); z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  margin: -30px -32px 18px; padding: 11px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.note-action-bar .back-link { margin: 0; }
.note-action-bar .page-actions { gap: var(--space-2); }

.note-editor-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.note-editor-main-wrap { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.note-editor-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.editor-attachments { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
#ai-zone:empty { display: none; }
.editor-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.editor-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--topbar-height) + 74px); padding-bottom: 28px; }
.editor-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.editor-title-input {
  width: 100%; border: 0; background: transparent; font-size: 24px; font-weight: 720; letter-spacing: -0.6px;
  padding: 4px 0; line-height: 1.25;
}
.editor-title-input:focus { outline: none; }
.editor-title-input::placeholder { color: var(--muted); opacity: 0.7; }
.editor-meta-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.editor-toolbar {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px; border: 1px solid var(--border);
  border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); flex-wrap: wrap;
}
.editor-toolbar .btn { height: 30px; font-size: 12px; padding: 0 9px; border-radius: 7px; }
.editor-toolbar .divider-vertical { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.editor-content {
  width: 100%; min-height: 420px; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  border-top: 0; background: var(--surface); padding: 18px; font-size: 14.5px; line-height: 1.7; resize: vertical;
}
.editor-content:focus { outline: none; }
.editor-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); padding: 2px 2px 0; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; flex: none; }
.side-card-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.side-card-head h3 { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.side-card-body { padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 13px; }
.side-card-body > :last-child { margin-bottom: 0; }
.meta-row { display: flex; flex-direction: column; gap: 5px; }
.meta-row > .field-label { font-size: 11.5px; }
.person-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.person-picker .person-chip { max-width: 100%; }

.audio-recorder {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.rec-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: var(--danger-soft); color: var(--danger); transition: all var(--transition);
}
.rec-btn:hover { background: var(--danger); color: #fff; }
.rec-btn.is-recording { background: var(--danger); color: #fff; animation: pulse 1.4s infinite; }
.btn.is-recording { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(211, 56, 56, 0.35); } 50% { box-shadow: 0 0 0 9px rgba(211, 56, 56, 0); } }
.rec-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rec-info strong { font-size: 12.5px; }
.rec-info span { font-size: 11.5px; color: var(--muted); }
.rec-time { font-family: var(--font-mono); font-size: 14px; font-weight: 650; color: var(--danger); }
.recording-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.audio-player { width: 100%; height: 38px; margin-top: 2px; }
.transcript-hint { font-size: 11.5px; color: var(--muted); display: flex; gap: 5px; align-items: flex-start; }

.ai-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.editor-attachments .ai-note { padding: 13px 14px; }
.editor-attachments .ai-note-head { flex-wrap: wrap; font-size: 11px; }
.editor-attachments .ai-note p { font-size: 12.2px; }
.editor-attachments .ai-suggestion label { font-size: 12px; }
.editor-attachments .ai-suggestion small { font-size: 11px; }
.ai-history { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ai-history-label { flex: none; color: var(--muted); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.ai-history .select { min-width: 0; height: 30px; padding-top: 3px; padding-bottom: 3px; font-size: 11px; }
.ai-note-head { display: flex; align-items: center; gap: 8px; color: var(--primary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.ai-note p { font-size: 13px; color: var(--text-soft); margin-top: 8px; }
.ai-note .ai-note-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }
.ai-suggestion {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-top: 1px dashed var(--border);
}
.ai-suggestion input { margin-top: 3px; }
.ai-suggestion label { font-size: 12.8px; }
.ai-suggestion small { display: block; color: var(--muted); font-size: 11.5px; }

/* ================================================================== */
/*  Fiche projet                                                       */
/* ================================================================== */

.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.back-link:hover { color: var(--primary); }
.project-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px;
  position: relative; overflow: hidden;
}
.project-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent, var(--primary)); }
.project-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.project-hero h1 { font-size: 25px; font-weight: 730; letter-spacing: -0.6px; line-height: 1.2; }
.project-hero-sub { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.project-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.project-stats { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)); gap: 16px; align-items: center; margin-top: 22px; }
.project-stat { padding-left: 16px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.project-stat strong { font-size: 19px; font-weight: 720; letter-spacing: -0.4px; }
.project-stat span { font-size: 11.5px; color: var(--muted); }
.project-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.detail-stack { display: flex; flex-direction: column; gap: 18px; }
.project-description { font-size: 13.5px; color: var(--text-soft); line-height: 1.65; white-space: pre-wrap; }
.doc-zone { display: flex; flex-direction: column; gap: 12px; }

/* ================================================================== */
/*  Kanban / plan d'action                                             */
/* ================================================================== */

.plan-hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; align-items: center;
}
.plan-hero h2 { font-size: 20px; font-weight: 720; letter-spacing: -0.4px; }
.plan-hero p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.plan-progress { display: flex; align-items: center; gap: 18px; }
.plan-progress-bars { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.plan-bar-row { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); }
.plan-bar-row .progress { flex: 1; }
.plan-bar-row strong { width: 34px; text-align: right; font-size: 11.5px; color: var(--text-soft); }

.kanban { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 180px; }
.kanban-col.is-drag-over { border-color: var(--primary); background: var(--primary-soft); }
.kanban-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.kanban-head h3 { font-size: 12.5px; font-weight: 680; }
.kanban-count { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--surface-3); padding: 1px 7px; border-radius: 20px; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px;
  box-shadow: var(--shadow-xs); cursor: grab; display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.kanban-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.kanban-card.is-dragging { opacity: 0.5; }
.kanban-card-title { font-size: 12.8px; font-weight: 570; line-height: 1.4; }
.kanban-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.kanban-card-done .kanban-card-title { text-decoration: line-through; color: var(--muted); }
.kanban-empty { padding: 18px 8px; text-align: center; font-size: 11.5px; color: var(--muted); }

/* ================================================================== */
/*  Calendrier                                                         */
/* ================================================================== */

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.calendar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.calendar-title { font-size: 17px; font-weight: 710; letter-spacing: -0.3px; text-transform: capitalize; }
.calendar-nav { display: flex; align-items: center; gap: 4px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.calendar-weekdays span { padding: 8px 10px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(106px, auto); }
.calendar-cell {
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 7px 8px 6px; min-width: 0;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background var(--transition);
}
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell:hover { background: var(--surface-2); }
.calendar-cell.is-outside { background: var(--surface-2); color: var(--muted); opacity: 0.65; }
.calendar-cell.is-today .cal-day { background: var(--primary); color: #fff; }
.calendar-cell.is-selected { background: var(--primary-soft); }
.cal-day { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 620; }
.cal-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-event {
  display: flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 2px 5px; border-radius: 5px;
  background: color-mix(in srgb, var(--accent, var(--primary)) 13%, transparent); color: var(--accent, var(--primary));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; max-width: 100%;
}
.cal-event .time { opacity: 0.8; font-variant-numeric: tabular-nums; }
.cal-more { font-size: 10px; color: var(--muted); padding-left: 4px; }
.calendar-side { display: flex; flex-direction: column; gap: 14px; }
.day-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.day-panel h3 { font-size: 14px; font-weight: 680; }
.day-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.day-panel-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.day-panel-footer { display: flex; gap: 8px; margin-top: 12px; }
.day-panel-footer .btn { flex: 1; }
.day-check {
  width: 18px; height: 18px; padding: 0; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--primary-contrast);
  transition: background var(--transition), border-color var(--transition);
}
.day-check:hover { border-color: var(--primary); }
.day-check.is-done { background: var(--primary); border-color: var(--primary); }
.day-check:disabled { opacity: 0.55; cursor: wait; }
.day-item.is-done .day-item-main .strong { text-decoration: line-through; color: var(--muted); }
.day-item.is-overdue .day-item-main .tiny { color: var(--danger); }
.day-item-state { flex: none; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.day-item.is-done .day-item-state { color: var(--success); }
.day-panel .day-list { margin-top: 12px; }
.day-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.day-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 12px; }

/* ================================================================== */
/*  Personnes                                                          */
/* ================================================================== */

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.person-card {
  display: flex; gap: 13px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; transition: all var(--transition); cursor: pointer;
}
.person-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.person-card-main { flex: 1; min-width: 0; }
.person-card h3 { font-size: 14.5px; font-weight: 650; letter-spacing: -0.1px; }
.person-card .person-role { font-size: 12px; color: var(--text-soft); margin-top: 1px; }
.person-card .person-org { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.person-card-foot { display: flex; gap: 10px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.person-detail-head { display: flex; gap: 16px; align-items: center; }
.person-detail-head .avatar { --avatar-size: 58px; }
.person-detail-head h2 { font-size: 20px; font-weight: 710; letter-spacing: -0.4px; }
.person-contact { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-soft); }
.person-contact a:hover { color: var(--primary); }
.person-contact span { display: inline-flex; gap: 7px; align-items: center; }

/* ================================================================== */
/*  Recherche                                                          */
/* ================================================================== */

.search-hero { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.search-hero h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.9px; }
.search-hero p { color: var(--muted); margin-top: 6px; }
.search-big { display: flex; align-items: center; gap: 10px; margin-top: 24px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; padding: 6px 8px 6px 16px; box-shadow: var(--shadow-sm); }
.search-big .icon { color: var(--muted); flex: none; }
.search-big input { flex: 1; border: 0; background: transparent; font-size: 16px; padding: 9px 0; outline: none; }
.search-results { max-width: 860px; margin: 28px auto 0; display: flex; flex-direction: column; gap: 20px; }
.search-group h2 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 680; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.search-group .count { background: var(--surface-3); border-radius: 20px; padding: 0 7px; font-size: 10.5px; }
.search-result {
  display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  margin-bottom: 7px; transition: all var(--transition);
}
.search-result:hover { border-color: var(--primary); background: var(--primary-soft); }
.search-result-title { font-size: 13.5px; font-weight: 620; }
.search-result-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.search-result-excerpt { font-size: 12.5px; color: var(--text-soft); margin-top: 5px; }

/* ================================================================== */
/*  Paramètres                                                         */
/* ================================================================== */

.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-height) + 20px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav button {
  display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; padding: 9px 12px;
  border-radius: 9px; font-size: 13px; color: var(--text-soft); font-weight: 540; transition: all var(--transition);
}
.settings-nav button:hover { background: var(--surface-2); color: var(--text); }
.settings-nav button.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 640; }
.settings-panel { display: flex; flex-direction: column; gap: 20px; max-width: 820px; }
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.settings-section-head { padding: 17px 20px 0; }
.settings-section-head h2 { font-size: 15.5px; font-weight: 680; letter-spacing: -0.2px; }
.settings-section-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.settings-section-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.setting-row-text strong { font-size: 13px; display: block; }
.setting-row-text small { color: var(--muted); font-size: 12px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; background: var(--surface);
  display: flex; flex-direction: column; gap: 8px; transition: all var(--transition); text-align: left;
}
.theme-card:hover { border-color: var(--border-strong); }
.theme-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.theme-preview { height: 62px; border-radius: 7px; border: 1px solid var(--border); overflow: hidden; display: flex; }
.theme-preview .tp-side { width: 26%; }
.theme-preview .tp-main { flex: 1; padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.theme-preview .tp-line { height: 4px; border-radius: 2px; }
.theme-preview.light { background: #f4f5fa; }
.theme-preview.light .tp-side { background: #fff; border-right: 1px solid #e6e8f1; }
.theme-preview.light .tp-line { background: #dfe3ef; }
.theme-preview.dark { background: #0b0d15; }
.theme-preview.dark .tp-side { background: #0f1220; border-right: 1px solid #252b3f; }
.theme-preview.dark .tp-line { background: #2a3148; }
.theme-preview.system { background: linear-gradient(90deg, #f4f5fa 50%, #0b0d15 50%); }
.theme-preview.system .tp-side { background: linear-gradient(90deg, #fff 50%, #0f1220 50%); }
.theme-preview.system .tp-line { background: linear-gradient(90deg, #dfe3ef 50%, #2a3148 50%); }
.theme-card-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.theme-card.is-active .theme-card-label { color: var(--primary); }

.ai-provider-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.provider-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: left; background: var(--surface);
  display: flex; gap: 11px; align-items: flex-start; transition: all var(--transition);
}
.provider-card:hover { border-color: var(--border-strong); }
.provider-card.is-active { border-color: var(--primary); background: var(--primary-soft); }
.provider-logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 12px;
  background: var(--surface-3); color: var(--text-soft);
}
.provider-card.is-active .provider-logo { background: var(--primary); color: #fff; }
.provider-card strong { display: block; font-size: 13px; }
.provider-card small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.settings-hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.excel-path { font-family: var(--font-mono); font-size: 12px; color: var(--text-soft); word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: 0; }
.session-item .icon { color: var(--muted); }
.session-info { flex: 1; min-width: 0; }
.session-info strong { font-size: 12.5px; display: block; }
.session-info small { font-size: 11px; color: var(--muted); }
.settings-about { display: flex; gap: 14px; align-items: center; }
.settings-about .brand-mark { width: 48px; height: 48px; border-radius: 14px; }

/* Marque : la boussole occupe ~80 % du carré, avec une marge régulière. */
.boot-logo .logo-mark-svg,
.brand-mark .logo-mark-svg,
.auth-brand-mark .logo-mark-svg {
  width: 80%; height: 80%; display: block;
  filter: drop-shadow(0 1px 1.5px rgba(30, 20, 80, 0.28));
}

/* ================================================================== */
/*  Boîte de capture                                                   */
/* ================================================================== */

.capture-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.capture-list { display: flex; flex-direction: column; gap: 10px; }
.capture-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.capture-icon { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.capture-card.is-link .capture-icon { background: var(--info-soft); color: var(--info); }
.capture-main { flex: 1; min-width: 0; }
.capture-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.capture-date { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.capture-card h3 { font-size: 14px; font-weight: 660; letter-spacing: -0.1px; }
.capture-preview { margin-top: 3px; color: var(--text-soft); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.capture-url { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin-top: 5px; color: var(--primary); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capture-url:hover { text-decoration: underline; }
.capture-converted { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--success); font-size: 11px; }
.capture-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex: none; }

/* ================================================================== */
/*  Engagements                                                        */
/* ================================================================== */

.commitment-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.commitment-stat {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs);
  color: var(--muted); font-size: 11.5px;
}
.commitment-stat span { display: inline-flex; align-items: center; gap: 5px; }
.commitment-stat strong { color: var(--text); font-size: 18px; font-weight: 730; letter-spacing: -0.3px; }
.commitment-stat.is-alert { border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.commitment-stat.is-alert strong, .commitment-stat.is-alert .icon { color: var(--danger); }
.commitment-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.commitment-list { display: flex; flex-direction: column; gap: 8px; }
.commitment-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.commitment-row.is-overdue { border-color: color-mix(in srgb, var(--danger) 24%, var(--border)); }
.commitment-row.is-done { opacity: 0.78; }
.commitment-check {
  width: 20px; height: 20px; padding: 0; margin-top: 1px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--primary-contrast);
}
.commitment-check:hover { border-color: var(--primary); }
.commitment-check.is-done { background: var(--primary); border-color: var(--primary); }
.commitment-main { flex: 1; min-width: 0; }
.commitment-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.commitment-title-row strong { font-size: 13.5px; font-weight: 650; }
.commitment-row.is-done .commitment-title-row strong { color: var(--muted); text-decoration: line-through; }
.commitment-direction { display: inline-flex; align-items: center; border-radius: 99px; padding: 1px 7px; font-size: 10px; font-weight: 650; }
.commitment-direction.mine { background: var(--primary-soft); color: var(--primary); }
.commitment-direction.theirs { background: var(--info-soft); color: var(--info); }
.commitment-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 11px; }
.commitment-meta span, .commitment-meta a { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.commitment-meta a:hover { color: var(--primary); }
.commitment-description { margin-top: 5px; color: var(--text-soft); font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.commitment-actions { display: flex; gap: 2px; flex: none; }

/* ================================================================== */
/*  Assistant IA                                                       */
/* ================================================================== */

.assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.chat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; height: calc(100vh - var(--topbar-height) - 150px); min-height: 480px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.chat-head .ai-orb { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-gradient); display: grid; place-items: center; color: #fff; flex: none; }
.chat-head h2 { font-size: 14px; font-weight: 680; }
.chat-head small { font-size: 11px; color: var(--muted); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.chat-bubble { max-width: 82%; display: flex; gap: 10px; align-items: flex-start; }
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.chat-bubble.assistant .chat-avatar { background: var(--brand-gradient); color: #fff; }
.chat-bubble.user .chat-avatar { background: var(--surface-3); color: var(--text-soft); }
.chat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.chat-content { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.chat-sources { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 0 2px; }
.chat-sources-label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.chat-source {
  display: inline-flex; align-items: center; gap: 5px; max-width: 230px; padding: 3px 8px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text-soft); font-size: 10.5px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.chat-source:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.chat-source .icon { flex: none; color: var(--muted); }
.chat-source:hover .icon { color: var(--primary); }
.chat-source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { display: flex; gap: 6px; padding: 0 1px; }
.chat-task-btn { height: 30px; padding: 0 10px; font-size: 11.5px; }
.chat-bubble.user .chat-content { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 18%, transparent); }
.chat-bubble.assistant .chat-content { border-bottom-left-radius: 4px; }
.chat-bubble.user .chat-content { border-bottom-right-radius: 4px; }
.chat-input-area { border-top: 1px solid var(--border); padding: 14px 16px; }
.chat-input-wrap {
  display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 7px 7px 7px 14px; background: var(--surface-2); box-shadow: 0 1px 2px rgba(20, 26, 52, 0.04);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.chat-input-wrap:hover { border-color: color-mix(in srgb, var(--primary) 28%, var(--border-strong)); }
.chat-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-strong));
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 10%, transparent);
}
.chat-input-wrap textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; font-size: 13.5px; max-height: 140px; min-height: 24px; padding: 5px 0; line-height: 1.5; }
.chat-input-wrap textarea::placeholder { color: var(--muted); opacity: 1; }
.chat-send { width: 38px; height: 38px; padding: 0; flex: none; border-radius: 10px; }
.chat-send .spinner { margin-right: 0; }
.chat-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chat-suggestion { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--text-soft); }
.chat-suggestion:hover { border-color: var(--primary); color: var(--primary); }
.chat-side { display: flex; flex-direction: column; gap: 14px; }
.ai-tip { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ================================================================== */
/*  Palette de commandes                                               */
/* ================================================================== */

.command-overlay {
  position: fixed; inset: 0; z-index: 160; background: rgba(10, 12, 24, 0.5); backdrop-filter: blur(5px);
  display: flex; align-items: flex-start; justify-content: center; padding: 10vh 20px 20px; opacity: 0; transition: opacity 0.15s;
}
[data-theme="dark"] .command-overlay { background: rgba(0, 0, 0, 0.65); }
.command-overlay.is-open { opacity: 1; }
.command-palette {
  width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(-8px) scale(0.99); transition: transform 0.15s;
}
.command-overlay.is-open .command-palette { transform: translateY(0) scale(1); }
.command-input-row { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.command-input-row .icon { color: var(--muted); }
.command-input-row input { flex: 1; border: 0; background: transparent; font-size: 15px; outline: none; }
.command-results { max-height: 54vh; overflow-y: auto; padding: 8px; }
.command-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 8px 10px 4px; font-weight: 650; }
.command-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--text-soft);
}
.command-item:hover, .command-item.is-active { background: var(--primary-soft); color: var(--primary); }
.command-item .icon { color: var(--muted); }
.command-item.is-active .icon { color: var(--primary); }
.command-item small { margin-left: auto; font-size: 11px; color: var(--muted); }
.command-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.command-foot { border-top: 1px solid var(--border); padding: 8px 14px; display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); }
.command-foot .kbd { font-size: 9.5px; }

/* ================================================================== */
/*  Skeleton / chargement                                              */
/* ================================================================== */

.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-card { height: 180px; border-radius: var(--radius); }

/* ================================================================== */
/*  Pages d'erreur                                                     */
/* ================================================================== */

.error-page { text-align: center; padding: 80px 20px; }
.error-page .error-code { font-size: 72px; font-weight: 800; letter-spacing: -4px; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-page h1 { font-size: 22px; font-weight: 720; margin-top: 10px; }
.error-page p { color: var(--muted); margin-top: 7px; }
.error-page .btn { margin-top: 20px; }

/* ================================================================== */
/*  Responsive                                                         */
/* ================================================================== */

@media (max-width: 1240px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .note-editor-shell { grid-template-columns: minmax(0, 1fr) 290px; }
  .note-editor-split { grid-template-columns: minmax(0, 1fr) 270px; }
  .calendar-layout { grid-template-columns: minmax(0, 1fr) 290px; }
}

@media (max-width: 1080px) {
  .project-detail-grid { grid-template-columns: 1fr; }
  .assistant-layout { grid-template-columns: 1fr; }
  .chat-side { display: none; }
  .note-editor-shell { grid-template-columns: 1fr; }
  .editor-side { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .settings-nav button { white-space: nowrap; }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-side { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .commitment-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capture-card { flex-wrap: wrap; }
  .capture-actions { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .commitment-row { flex-wrap: wrap; }
  .commitment-actions { margin-left: 32px; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(10, 12, 24, 0.45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }
  .mobile-toggle { display: grid; }
  .topbar { padding: 0 16px; }
  .page { padding: 22px 18px 64px; }
  .note-action-bar { margin: -22px -18px 16px; padding: 10px 18px; }
  .note-editor-split { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-visual { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel { padding: 32px 20px; }
  .project-stats { grid-template-columns: repeat(2, 1fr); }
  .project-stat { border-left: 0; padding-left: 0; }
  .kanban { display: flex; flex-direction: column; }
  .kanban-col { width: 100%; }
  .plan-hero { grid-template-columns: 1fr; }
  .dashboard-two { grid-template-columns: 1fr; }
  .calendar-grid { grid-auto-rows: minmax(76px, auto); }
  .cal-event { font-size: 9px; padding: 1px 3px; }
  .cal-event .time { display: none; }
  .theme-options { grid-template-columns: 1fr; }
  .ai-provider-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .today-board-head { flex-direction: column; gap: 12px; }
  .today-board-actions { width: 100%; }
  .today-board-actions .btn { flex: 1; }
  .today-board-body { grid-template-columns: 1fr; }
  .today-panel + .today-panel { border-left: 0; border-top: 1px solid var(--border); }
  .search-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger .kbd { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-value { font-size: 20px; }
  .dashboard-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .dashboard-hero-actions { width: 100%; }
  .dashboard-hero-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .projects-grid, .notes-grid, .people-grid { grid-template-columns: 1fr; }
  .project-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: 92vh; }
  .tabs { gap: 0; }
  .tab { padding: 9px 10px; font-size: 12px; }
  .calendar-weekdays span { font-size: 9px; padding: 6px 0; }
  .calendar-grid { grid-auto-rows: minmax(64px, auto); }
  .cal-day { width: 20px; height: 20px; font-size: 10.5px; }
  .calendar-cell { padding: 4px; }
  .toast-stack { right: 12px; left: 12px; width: auto; bottom: 12px; }
  .auth-card-head h2 { font-size: 23px; }
  .page-head h1 { font-size: 24px; }
  .project-hero { padding: 18px; }
  .project-hero h1 { font-size: 21px; }
  .qr-box { flex-direction: column; align-items: flex-start; }
  .search-hero h1 { font-size: 25px; }
  .search-big input { font-size: 14px; }
  .chat-card { height: calc(100vh - var(--topbar-height) - 110px); }
  .chat-bubble { max-width: 92%; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
}

/* Densité compacte */
[data-density="compact"] .data-table td { padding: 8px 14px; }
[data-density="compact"] .task-row { padding: 9px 4px; }
[data-density="compact"] .note-card { min-height: 168px; }
[data-density="compact"] .card-pad { padding: 16px; }

/* Réduction des animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ================================================================== */
/*  Compléments : menus, divers                                        */
/* ================================================================== */

.user-menu-pop {
  position: fixed; z-index: 180; width: 264px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; transform: translateY(-6px) scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.user-menu-pop.is-open { opacity: 1; transform: translateY(0) scale(1); }
.user-menu-head { display: flex; gap: 11px; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); }
.user-menu-head strong { display: block; font-size: 13px; }
.user-menu-head > div > span { display: block; font-size: 11.5px; color: var(--muted); }
.user-menu-items { padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.user-menu-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  font-size: 13px; color: var(--text-soft); width: 100%; text-align: left;
}
.user-menu-item:hover { background: var(--surface-2); color: var(--text); }
.user-menu-item.is-danger { color: var(--danger); }
.user-menu-item.is-danger:hover { background: var(--danger-soft); }
.user-menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }

.banner.is-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 24%, transparent); color: var(--info); }
.banner.is-info .icon { color: var(--info); }

.people-pick-item:hover { background: var(--surface-2); }
.people-pick-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.day-item:hover { background: var(--surface-2); border-radius: 8px; }
.day-item-main:hover .strong { color: var(--primary); }
.color-swatch { transition: transform 0.12s ease, border-color 0.12s ease; }
.color-swatch:hover { transform: scale(1.12); }

.editor-saved-state { margin-right: 2px; }

.topbar .avatar { border-color: transparent; }
.data-table .avatar { border-color: var(--surface); }

.settings-section .switch-row { padding: 2px 0; }
.settings-section .form-grid .field { min-width: 0; }
.modal .form-grid { gap: 14px; }

.ai-points li { line-height: 1.55; }
.ai-points li .icon { color: var(--warning); }

.section-head h2 { line-height: 1.3; }
.search-results .search-group { animation: fade-in 0.22s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.command-item mark { background: transparent; }

.error-page .btn { display: inline-flex; }

[data-density="compact"] .sidebar-inner { padding-top: 14px; }
[data-density="compact"] .nav-link { padding: 7px 12px; }
[data-density="compact"] .page { padding-top: 22px; }

@media (max-width: 760px) {
  .auth-panel { align-items: flex-start; padding-top: 28px; }
  .auth-card-head h2 { font-size: 22px; }
  .qr-box img { width: 132px; height: 132px; }
}

/* Panneau latéral de l'éditeur : évite un élément collant plus haut que l'écran */
.editor-side {
  max-height: calc(100vh - var(--topbar-height) - 96px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}
@media (max-width: 900px) {
  .editor-side { max-height: none; overflow: visible; padding-right: 0; }
}
.brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================== */
/*  Mode Démo                                                          */
/* ================================================================== */

.auth-mode {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 22px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
}
.auth-mode button {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 38px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 620; transition: all var(--transition);
}
.auth-mode button:hover { color: var(--text); }
.auth-mode button.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }
.auth-mode button:disabled { opacity: 0.45; cursor: not-allowed; }
.auth-mode-hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 8px; min-height: 18px; }

.demo-banner {
  display: flex; align-items: center; gap: 10px; padding: 9px 28px;
  font-size: 12.5px; color: var(--text-soft);
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--accent-blue) 8%, transparent));
  border-bottom: 1px solid var(--border);
}
.demo-banner .icon { color: var(--primary); flex: none; }
.demo-banner strong { color: var(--primary); }
.demo-banner .btn { margin-left: auto; flex: none; }
[data-theme="dark"] .demo-banner { background: linear-gradient(90deg, rgba(80, 160, 220, 0.16), rgba(0, 86, 164, 0.10)); }
@media (max-width: 680px) {
  .demo-banner { padding: 9px 16px; flex-wrap: wrap; font-size: 11.5px; }
  .demo-banner .btn { margin-left: 0; width: 100%; }
}

.task-person-names { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dictée vocale dans les formulaires */
.field-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px;
}
.dictate-btn {
  width: 27px; height: 27px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  color: var(--text-soft); transition: all var(--transition);
}
.dictate-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.dictate-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dictate-btn.is-recording {
  color: var(--danger); border-color: var(--danger); background: var(--danger-soft);
  animation: pulse 1.4s infinite;
}

/* Outils de champ : dictée + effacement */
.field-tools { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.clear-field-btn {
  width: 27px; height: 27px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  color: var(--muted); transition: all var(--transition);
}
.clear-field-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.clear-field-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.editor-title-row { display: flex; align-items: flex-start; gap: 10px; }
.editor-title-row .editor-title-input { flex: 1; min-width: 0; }
.editor-title-row .field-tools { margin-top: 6px; }

/* Bascule Démo / Pas démo dans le menu utilisateur */
.user-menu-mode { padding: 11px 16px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.user-menu-mode-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.user-menu-mode-label span { font-size: 11.5px; font-weight: 650; color: var(--text-soft); }
.user-menu-mode-label small { font-size: 10.5px; color: var(--muted); }
.user-menu-mode .segmented { display: flex; width: 100%; }
.user-menu-mode .segmented button { flex: 1; justify-content: center; padding: 6px 8px; font-size: 11.5px; }
.user-menu-mode .segmented button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Le libellé d'une tâche ouvre sa fenêtre d'édition */
.task-title-button {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit;
  text-align: left; cursor: pointer; border-radius: 4px;
}
.task-title-button:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.task-title-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.task-delete:hover { color: var(--danger); background: var(--danger-soft); }

/* Les piles d'avatars ne doivent pas être étirées par les règles de ligne .overdue-item */
.overdue-item .avatar-stack { flex: none; overflow: visible; white-space: normal; }
.overdue-item .avatar {
  flex: none; width: var(--avatar-size, 24px); height: var(--avatar-size, 24px);
  overflow: hidden; text-overflow: clip; white-space: nowrap;
}
.overdue-item .avatar-stack .avatar + .avatar { margin-left: -7px; }

/* Afficher tous les noms des personnes affectées à une tâche */
.task-person { flex-wrap: wrap; max-width: 100%; }
.task-person-names { max-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; }

/* Dans les dernières notes, le badge de type garde sa largeur naturelle */
.overdue-item .note-type { flex: none; }

/* Version de l'application en bas de la sidebar */
.sidebar-version {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding: 11px 12px 0; border-top: 1px solid var(--border);
  font-size: 10.5px; color: var(--muted); letter-spacing: 0.03em;
}
.sidebar-version span:last-child { font-family: var(--font-mono); }
