/* ============================================================
   DARBYON · Pilotage (ERP + CRM)
   Design system Darbyon (sept. 2026) : Makking, encre jade, carré,
   pas d'ombres, filets sea, volt = une seule étincelle.
   Tokens repris tels quels de darbyon-design-system/src/styles/tokens.css.
   Les anciennes variables (--teal, --ink, --grey-*) restent comme alias :
   app.js s'en sert dans ~900 styles inline.
   ============================================================ */

/**
 * @license
 * MyFonts Webfont Build ID 3867246, 2020-12-16T11:57:38-0500
 * The fonts listed in this notice are subject to the End User License
 * Agreement(s) entered into by the website owner. All other parties are
 * explicitly restricted from using the Licensed Webfonts(s).
 * Webfont: Makking Regular / Light / Medium / Semi Bold / Bold / Extra Bold by Sryga
 * URL: https://www.myfonts.com/collections/sryga-foundry
 * © 2026 MyFonts Inc.
 * Licence : sites et apps Darbyon uniquement (assets/fonts/makking/LICENSE-NOTICE.md).
 */
@font-face { font-family: "Makking"; font-weight: 300; font-style: normal; font-display: swap; ascent-override: 85.45%; descent-override: 14.55%; line-gap-override: 0%; src: url("assets/fonts/makking/makking-300-light.woff2") format("woff2"); }
@font-face { font-family: "Makking"; font-weight: 400; font-style: normal; font-display: swap; ascent-override: 85.45%; descent-override: 14.55%; line-gap-override: 0%; src: url("assets/fonts/makking/makking-400-regular.woff2") format("woff2"); }
@font-face { font-family: "Makking"; font-weight: 500; font-style: normal; font-display: swap; ascent-override: 85.45%; descent-override: 14.55%; line-gap-override: 0%; src: url("assets/fonts/makking/makking-500-medium.woff2") format("woff2"); }
@font-face { font-family: "Makking"; font-weight: 600; font-style: normal; font-display: swap; ascent-override: 85.45%; descent-override: 14.55%; line-gap-override: 0%; src: url("assets/fonts/makking/makking-600-semibold.woff2") format("woff2"); }
@font-face { font-family: "Makking"; font-weight: 700; font-style: normal; font-display: swap; ascent-override: 85.45%; descent-override: 14.55%; line-gap-override: 0%; src: url("assets/fonts/makking/makking-700-bold.woff2") format("woff2"); }
@font-face { font-family: "Makking"; font-weight: 800; font-style: normal; font-display: swap; ascent-override: 85.45%; descent-override: 14.55%; line-gap-override: 0%; src: url("assets/fonts/makking/makking-800-extrabold.woff2") format("woff2"); }

:root {
  /* ---------- Tokens Darbyon ---------- */
  --dy-white: #ffffff;
  --dy-jade-950: #001414;
  --dy-jade-900: #001f1f;
  --dy-jade-800: #002e32;
  --dy-jade-700: #004743;
  --dy-teal: #00948e;
  --dy-sea: #94d1d1;
  --dy-mint: #b3f6d6;
  --dy-volt: #dbff98;
  --dy-mist: #eef5f5;
  --dy-mist-hover: #def7ec;
  --dy-row-hover: #f5fafa;
  --dy-track: #d9faea;
  --dy-volt-pale: #edffcc;
  --dy-ink: #004743;
  --dy-ink-strong: #001f1f;
  --dy-ink-title: #002e32;
  --dy-muted: rgba(0, 71, 67, 0.72);
  --dy-placeholder: rgba(0, 71, 67, 0.6);
  --dy-danger: #c62f14;
  --dy-error: #e53c1a;
  --dy-chip-revision: #edffcc;  --dy-chip-revision-fg: #4f7110;
  --dy-chip-progress: #dcf8ea;  --dy-chip-progress-fg: #106f41;
  --dy-chip-client: #dcefef;    --dy-chip-client-fg: #235252;
  --dy-chip-neutral: #eef5f5;   --dy-chip-neutral-fg: #2c6d6d;
  --dy-chip-stalled: #fce3de;   --dy-chip-stalled-fg: #b52f14;
  --dy-grad-cta: linear-gradient(251deg, #002e32 6%, #00948e 54%, #dbff98 100%);
  --dy-grad-progress: linear-gradient(90deg, #dbff98, #00948e, #004743);
  --dy-grad-sidebar: linear-gradient(180deg, #001414 0%, #001f1f 45%, #002e32 82%, #004743 100%);
  --dy-bar: rgba(255, 255, 255, 0.8);
  --dy-glass: rgba(255, 255, 255, 0.1);
  --dy-glass-hover: rgba(255, 255, 255, 0.2);
  --dy-frost: rgba(0, 0, 0, 0.15);
  --dy-overlay: rgba(0, 20, 20, 0.6);
  --dy-sidebar-hairline: rgba(148, 209, 209, 0.2);
  --dy-sidebar-label: rgba(148, 209, 209, 0.6);
  --dy-sidebar-rule: rgba(179, 246, 214, 0.2);
  --dy-dark-field-rule: rgba(255, 255, 255, 0.3);
  --dy-dark-placeholder: rgba(148, 209, 209, 0.7);
  --dy-frame: inset 0 0 0 1px var(--dy-sea);
  --dy-frame-selected: inset 3px 0 0 var(--dy-teal);
  --dy-font: Makking, Geist, "Helvetica Neue", Arial, sans-serif;
  --dy-ease: cubic-bezier(.7, 0, 0, 1);

  /* ---------- Alias historiques (utilisés inline dans app.js) ---------- */
  --white:      var(--dy-white);
  --teal:       var(--dy-teal);
  --teal-deep:  var(--dy-jade-700);
  --warm:       var(--dy-sea);
  --warm-deep:  var(--dy-chip-revision-fg);
  --ink:        var(--dy-ink);
  --grey-300:   var(--dy-sea);
  --grey-200:   var(--dy-mist);
  --grey-100:   var(--dy-row-hover);
  --grey-600:   var(--dy-muted);
  --grey-muted: var(--dy-muted);
  --teal-tint:  var(--dy-mist);
  --warm-tint:  var(--dy-volt-pale);

  --sidebar-w:  260px;
  --radius:     0;
  --radius-sm:  0;
  --shadow:     none;
  --font:       var(--dy-font);
}

* { box-sizing: border-box; margin: 0; padding: 0; border-color: var(--dy-sea); }
html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { font-family: var(--dy-font); font-weight: 400; font-size: 14px; line-height: 1.4; color: var(--dy-ink); background: var(--dy-white); font-feature-settings: "kern"; }
h1, h2, h3, h4, h5, h6 { font-weight: 400; }
b, strong { font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
::placeholder { color: var(--dy-placeholder); opacity: 1; }
::selection { background: var(--dy-volt-pale); color: var(--dy-ink-title); }
:focus-visible { outline: 1px solid var(--dy-jade-800); outline-offset: 3px; }
[data-surface="dark"] :focus-visible, [data-surface="dark"]:focus-visible { outline-color: var(--dy-white); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--dy-jade-800); }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
svg.ico { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ---------- Logo ---------- */
.dy-logo { display: block; width: 117px; height: 23px; color: var(--dy-jade-900); flex: 0 0 auto; }
.dy-logo.lg { width: 152px; height: 30px; }

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

/* ---------- Connexion (moment de marque : aurora + verre) ---------- */
#authGate { display: none; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--dy-jade-950) url("assets/brand/bg-aurora-05.jpg") center / cover no-repeat; position: relative; }
#authGate::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,20,20,.3) 0%, rgba(0,20,20,0) 30%, rgba(0,20,20,0) 70%, rgba(0,20,20,.5) 100%); pointer-events: none; }
#authGate.show { display: flex; }
.auth-card.card { position: relative; width: 400px; max-width: 100%; padding: 50px 40px 40px; background: var(--dy-frost); -webkit-backdrop-filter: blur(100px); backdrop-filter: blur(100px); box-shadow: none; color: var(--dy-white); }
.auth-brand { padding: 0; border: none; margin-bottom: 30px; }
.auth-brand .dy-logo { color: var(--dy-white); }
.auth-brand .product { color: var(--dy-sea); }
.auth-lede { font-size: 14px; color: var(--dy-sea); margin: 0 0 30px; line-height: 1.5; }
.auth-lbl { display: block; font-weight: 500; font-size: 12px; color: var(--dy-sea); margin: 0 0 10px; }
.auth-input { width: 100%; border: 0; border-bottom: 1px solid var(--dy-dark-field-rule); border-radius: 0; padding: 0 0 12px; font-size: 16px; color: var(--dy-white); background: transparent; margin-bottom: 30px; transition: border-color .15s var(--dy-ease); }
.auth-input::placeholder { color: var(--dy-dark-placeholder); }
.auth-input:focus { outline: none; border-bottom-color: var(--dy-white); }
.auth-err { color: var(--dy-volt); font-size: 12px; font-weight: 500; min-height: 16px; margin: -15px 0 15px; }
#authGate .btn.primary { background: var(--dy-white); color: var(--dy-ink); height: 50px; }
#authGate .btn.primary:hover { background: var(--dy-mint); }
#authGate :focus-visible { outline-color: var(--dy-white); }

/* ---------- Accueil (hub CRM / ERP) ---------- */
#hub { display: none; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 20px; background: var(--dy-white); }
#hub.show { display: flex; }
.hub-inner { width: 760px; max-width: 100%; }
.hub-brand { padding: 0; border: none; margin-bottom: 50px; }
.hub-lede { font-size: 40px; font-weight: 300; letter-spacing: -0.03em; color: var(--dy-ink-title); line-height: 1.1; margin: 0 0 40px; }
.hub-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .hub-choices { grid-template-columns: 1fr; } .hub-lede { font-size: 30px; } }
.hub-card { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; text-align: left; background: var(--dy-mist); border: 0; border-radius: 0; padding: 30px; min-height: 220px; transition: background-color .15s var(--dy-ease); }
.hub-card:hover { background: var(--dy-mist-hover); }
.hub-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--dy-jade-800); color: var(--dy-white); }
.hub-ico .ico { width: 18px; height: 18px; }
.hub-name { font-size: 30px; font-weight: 300; letter-spacing: -0.02em; color: var(--dy-ink-title); line-height: 1; margin-top: auto; }
.hub-desc { font-size: 14px; color: var(--dy-muted); line-height: 1.45; min-height: 40px; }
.hub-brand .product { color: var(--dy-muted); }
.hub-go { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--dy-ink); }
.hub-go .ico { width: 12px; height: 12px; transition: transform .15s var(--dy-ease); }
.hub-card:hover .hub-go .ico { transform: translateX(3px); }
.hub-logout { border: none; background: transparent; color: var(--dy-ink); font-size: 12px; font-weight: 500; margin-top: 40px; text-decoration: underline; text-decoration-color: var(--dy-sea); text-underline-offset: 4px; }
.hub-logout:hover { text-decoration-color: var(--dy-jade-800); }

/* ---------- Sidebar (dégradé jade, texte sea, actif volt) ---------- */
.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--dy-grad-sidebar); color: var(--dy-sea); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 30px 20px 25px; display: flex; align-items: flex-end; gap: 10px; }
.sidebar .brand .dy-logo { color: var(--dy-white); width: 102px; height: 20px; }
.brand-logo { display: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand .wordmark { display: none; }
.brand .product { display: block; font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: 0; line-height: 1; color: var(--dy-sea); padding-bottom: 2px; }

.nav { padding: 10px 0 20px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--dy-sidebar-hairline) transparent; }
.group-label { font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: 0; color: var(--dy-muted); padding: 20px 20px 10px; }
.nav .group-label { font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: 0; color: var(--dy-sidebar-label); padding: 20px 20px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 20px; border-radius: 0; color: var(--dy-sea); font-weight: 400; font-size: 14px; line-height: 1; position: relative; border: none; background: none; width: 100%; text-align: left; transition: color .15s var(--dy-ease), background-color .15s var(--dy-ease); }
.nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { color: var(--dy-white); }
.nav-item.active { background: var(--dy-glass); color: var(--dy-volt); font-weight: 500; }
.nav-item.active::before { content: ""; position: absolute; left: 9px; top: 50%; width: 3px; height: 3px; margin-top: -1.5px; background: var(--dy-volt); }
.nav-item .ico { width: 16px; height: 16px; flex: 0 0 16px; }
.nav-item .badge-count { flex: 0 0 auto; background: var(--dy-volt); color: var(--dy-jade-900); font-size: 10px; font-weight: 700; padding: 3px 5px; border-radius: 0; line-height: 1; }
.sidebar :focus-visible { outline: 1px solid var(--dy-white); outline-offset: -1px; }

.side-foot { padding: 20px; border-top: 1px solid var(--dy-sidebar-rule); }
.sidebar .btn { background: var(--dy-glass); color: var(--dy-white); }
.sidebar .btn:hover { background: var(--dy-glass-hover); }
.role-switch { display: flex; box-shadow: inset 0 0 0 1px var(--dy-sidebar-hairline); }
.role-switch button { flex: 1; border: none; background: none; height: 32px; padding: 0 8px; border-radius: 0; font-size: 12px; font-weight: 500; color: var(--dy-sea); transition: color .15s var(--dy-ease), background-color .15s var(--dy-ease); }
.role-switch button:hover { color: var(--dy-white); }
.role-switch button.on { background: var(--dy-glass); color: var(--dy-white); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; background: var(--dy-volt); color: var(--dy-jade-900); font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.user-chip .who { font-size: 14px; font-weight: 400; color: var(--dy-white); }
.user-chip .who small { display: block; font-weight: 400; color: var(--dy-sea); font-size: 12px; margin-top: 3px; }
.user-chip .btn, .user-chip button { background: transparent; color: var(--dy-sea); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--dy-white); }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--dy-bar); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--dy-sea); padding: 30px 40px 25px; display: flex; align-items: flex-end; gap: 15px; }
.topbar .titles { flex: 1; min-width: 0; }
.eyebrow { font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: 0; color: var(--dy-muted); line-height: 1; }
.page-title { font-weight: 300; font-size: 40px; line-height: 1.05; letter-spacing: -0.03em; color: var(--dy-ink-title); margin-top: 10px; }
.crumbs { font-size: 12px; color: var(--dy-ink); font-weight: 500; margin-bottom: 10px; }
.crumbs a:hover { color: var(--dy-ink-strong); text-decoration: underline; text-decoration-color: var(--dy-sea); text-underline-offset: 4px; }
.crumbs .sep { margin: 0 8px; color: var(--dy-sea); }
.month-select, .topbar select { height: 40px; border: 0; border-bottom: 1px solid var(--dy-sea); border-radius: 0; background: transparent; color: var(--dy-ink-title); padding: 0 24px 0 0; font-size: 14px; font-weight: 400; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23004743' stroke-width='1.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; min-width: 160px; cursor: pointer; }
.content { padding: 40px 40px 80px; max-width: 1320px; width: 100%; }

/* ---------- Titres ---------- */
.section { margin-top: 50px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--dy-sea); }
h2.sec { font-weight: 400; font-size: 20px; letter-spacing: -0.02em; color: var(--dy-ink-strong); line-height: 1.15; }
h3.sub { font-weight: 400; font-size: 16px; letter-spacing: -0.01em; color: var(--dy-ink-title); }
.muted { color: var(--dy-muted); }
.lede { font-weight: 400; font-size: 14px; line-height: 1.5; color: var(--dy-muted); max-width: 760px; }

/* ---------- KPI (tuiles mist, gros chiffres light) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.kpi { background: var(--dy-mist); border: 0; border-radius: 0; padding: 20px; }
.kpi.alt { background: var(--dy-row-hover); }
.kpi .label { font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: 0; color: var(--dy-muted); line-height: 1.2; }
.kpi .value { font-weight: 300; font-size: 30px; white-space: nowrap; line-height: 1; letter-spacing: -0.03em; margin-top: 15px; color: var(--dy-ink-title); font-variant-numeric: tabular-nums; }
.kpi .value .unit { font-size: 18px; font-weight: 300; color: var(--dy-muted); margin-left: 3px; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12px; font-weight: 500; margin-top: 10px; }
.kpi .delta.pos { color: var(--dy-chip-progress-fg); }
.kpi .delta.neg { color: var(--dy-muted); }
.kpi .sub { font-size: 12px; color: var(--dy-muted); margin-top: 10px; line-height: 1.35; }
.kpi .bar { height: 3px; background: var(--dy-track); border-radius: 0; margin-top: 15px; overflow: hidden; }
.kpi .bar > i { display: block; height: 100%; background: var(--dy-grad-progress); border-radius: 0; }
.kpi .bar > i.warm { background: var(--dy-sea); }

/* ---------- Cartes / panneaux (cadre filet sea, pas d'ombre) ---------- */
.card { background: var(--dy-white); border: 0; border-radius: 0; box-shadow: var(--dy-frame); padding: 20px; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px; border-bottom: 1px solid var(--dy-sea); }
.card-head h3 { font-weight: 400; font-size: 16px; letter-spacing: -0.01em; color: var(--dy-ink-title); }
.card-head .eyebrow { font-size: 10px; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stack > * + * { margin-top: 20px; }

/* ---------- Tables (en-tête 10 ExtraBold, filet jade, lignes 44 sur filets sea) ---------- */
.tbl-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { background: transparent; color: var(--dy-ink-strong); font-weight: 800; font-size: 10px; text-transform: uppercase; letter-spacing: 0; padding: 12px 15px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--dy-jade-700); }
table.tbl th.num, table.tbl td.num { text-align: right; }
table.tbl td { height: 44px; padding: 10px 15px; border-bottom: 1px solid var(--dy-sea); font-size: 14px; color: var(--dy-ink); vertical-align: middle; }
table.tbl tbody tr:nth-child(even) td { background: transparent; }
table.tbl tbody tr.click { cursor: pointer; }
table.tbl tbody tr.click:hover td, table.tbl tbody tr:hover td { background: var(--dy-row-hover); }
table.tbl .pos { color: var(--dy-chip-progress-fg); font-weight: 500; }
table.tbl .neg { color: var(--dy-muted); font-weight: 400; }
table.tbl .strong { font-weight: 500; color: var(--dy-ink-title); }
.t-primary { font-weight: 500; color: var(--dy-ink-title); }
.t-sub { color: var(--dy-muted); font-size: 12px; }
tfoot td { font-weight: 500; color: var(--dy-ink-title); border-top: 1px solid var(--dy-jade-700); background: var(--dy-mist) !important; }
table.tbl input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ---------- Badges = chips ronds ton sur ton ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; line-height: 1; padding: 4px 7px 3px; border-radius: 999px; white-space: nowrap; background: var(--dy-chip-neutral); color: var(--dy-chip-neutral-fg); }
.badge .d { width: 5px; height: 5px; border-radius: 0; background: currentColor; }
.badge.ok      { background: var(--dy-chip-progress); color: var(--dy-chip-progress-fg); }
.badge.wait    { background: var(--dy-chip-revision); color: var(--dy-chip-revision-fg); }
.badge.neutral { background: var(--dy-chip-neutral); color: var(--dy-chip-neutral-fg); }
.badge.info    { background: var(--dy-chip-client); color: var(--dy-chip-client-fg); }
.badge.bad, .badge.danger, .badge.late { background: var(--dy-chip-stalled); color: var(--dy-chip-stalled-fg); }

/* ---------- Boutons (carrés, 12 Bold ; défaut = secondaire mist) ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; justify-content: center; height: 40px; border: 0; border-radius: 0; background: var(--dy-mist); color: var(--dy-ink); padding: 0 15px; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; transition: background-color .15s var(--dy-ease), color .15s var(--dy-ease), filter .15s var(--dy-ease); }
.btn:hover { background: var(--dy-mist-hover); }
.btn.primary, .btn.deep { background: var(--dy-jade-800); color: var(--dy-white); }
.btn.primary:hover, .btn.deep:hover { background: var(--dy-jade-700); }
.btn.gradient { color: var(--dy-white); background: var(--dy-grad-cta); }
.btn.gradient:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--dy-ink); }
.btn.ghost:hover { background: var(--dy-mist); }
.btn.outline { background: transparent; box-shadow: var(--dy-frame); }
.btn.outline:hover { background: var(--dy-mist); }
.btn.danger { background: transparent; color: var(--dy-danger); box-shadow: var(--dy-frame); }
.btn.danger:hover { background: var(--dy-mist); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.lg { height: 50px; padding: 0 20px; }
.btn .ico { width: 16px; height: 16px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ---------- Onglets (12 Medium, gap 30, carré 3 px sous l'actif) ---------- */
.tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--dy-sea); margin-bottom: 30px; flex-wrap: wrap; }
.tab { position: relative; border: none; background: none; padding: 0 0 12px; font-size: 12px; font-weight: 500; line-height: 1; color: var(--dy-ink); white-space: nowrap; transition: color .15s var(--dy-ease); }
.tab:hover { color: var(--dy-ink-strong); }
.tab.active { color: var(--dy-ink-strong); }
.tab.active::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 3px; height: 3px; margin-left: -1.5px; background: currentColor; }
.tab .count { color: inherit; font-weight: 500; margin-left: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.tab.active .count { color: inherit; }
.tab-panel { display: none; }
.tab-panel.show { display: block; animation: fade .3s var(--dy-ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Callout (tuile mist) ---------- */
.callout { background: var(--dy-mist); border-left: 0; box-shadow: var(--dy-frame-selected); padding: 20px; border-radius: 0; }
.callout .tag { font-weight: 800; text-transform: uppercase; letter-spacing: 0; font-size: 10px; color: var(--dy-muted); margin-bottom: 10px; display: block; }

/* ---------- Formulaires (champs remplis mist + filet) ---------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 500; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--dy-ink); margin-bottom: 10px; }
.field input, .field select, .field textarea { width: 100%; border: 0; border-bottom: 1px solid var(--dy-sea); border-radius: 0; padding: 12px 12px 11px; font-size: 14px; color: var(--dy-ink-title); background: var(--dy-mist); transition: border-color .15s var(--dy-ease), background-color .15s var(--dy-ease); }
.field input[type="checkbox"], .field input[type="radio"] { width: auto; }
.field textarea { line-height: 1.45; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--dy-jade-800); background: var(--dy-mist-hover); }
.field .hint { font-size: 12px; color: var(--dy-muted); margin-top: 8px; line-height: 1.4; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 120px; border: 0; border-radius: 0; box-shadow: var(--dy-frame); padding: 15px; text-transform: none; letter-spacing: 0; color: var(--dy-ink-title); font-weight: 400; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; background: var(--dy-white); transition: background-color .15s var(--dy-ease); }
.seg label:hover { background: var(--dy-row-hover); }
.seg label small { display: block; font-weight: 400; color: var(--dy-muted); font-size: 12px; margin-top: 3px; }
.seg input { display: none; }
.seg label.sel { background: var(--dy-mist); box-shadow: var(--dy-frame-selected); }
.seg label .tick { width: 12px; height: 12px; border-radius: 0; box-shadow: inset 0 0 0 1px var(--dy-sea); flex: 0 0 12px; }
.seg label.sel .tick { background: var(--dy-jade-800); box-shadow: inset 0 0 0 3px var(--dy-mist); }

/* ---------- Drop zone ---------- */
.drop { border: 1px dashed var(--dy-sea); border-radius: 0; padding: 30px 20px; text-align: center; color: var(--dy-muted); background: var(--dy-row-hover); }
.drop strong { color: var(--dy-ink-title); font-weight: 500; }

/* ---------- Éditeur de lignes ---------- */
table.tbl.ed th { background: transparent; color: var(--dy-ink-strong); padding: 8px; }
table.tbl.ed td { height: auto; padding: 5px; border-bottom: 1px solid var(--dy-sea); }
table.tbl.ed tbody tr:hover td { background: transparent; }
table.tbl.ed input, table.tbl.ed select { width: 100%; border: 0; border-bottom: 1px solid transparent; border-radius: 0; padding: 8px; font-size: 14px; color: var(--dy-ink-title); background: var(--dy-mist); }
table.tbl.ed input:focus, table.tbl.ed select:focus { outline: none; border-bottom-color: var(--dy-jade-800); background: var(--dy-mist-hover); }
.ed-del { border: none; background: none; color: var(--dy-muted); font-size: 18px; line-height: 1; padding: 0 5px; cursor: pointer; }
.ed-del:hover { color: var(--dy-danger); }
.ed-totals { display: flex; justify-content: flex-end; gap: 30px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--dy-jade-700); }
.ed-totals div { font-size: 12px; font-weight: 500; color: var(--dy-muted); }
.ed-totals b { color: var(--dy-ink-title); font-weight: 400; font-size: 16px; margin-left: 10px; font-variant-numeric: tabular-nums; }

/* ---------- Modale (carrée, blanche, voile jade flouté) ---------- */
.overlay { position: fixed; inset: 0; background: var(--dy-overlay); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 60; overflow-y: auto; }
.overlay.show { display: flex; animation: fade .3s var(--dy-ease); }
.modal { background: var(--dy-white); border-radius: 0; width: 100%; max-width: 680px; box-shadow: none; margin-bottom: 60px; }
.modal.wide { max-width: 960px; }
.modal-head { padding: 40px 40px 20px; border-bottom: 1px solid var(--dy-sea); display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-head .eyebrow { font-size: 10px; }
.modal-head h3 { font-weight: 300; font-size: 30px; margin-top: 10px; letter-spacing: -0.02em; color: var(--dy-ink-title); line-height: 1.1; }
.modal-body { padding: 30px 40px; }
.modal-foot { padding: 20px 40px 40px; border-top: 0; display: flex; justify-content: flex-end; gap: 10px; background: transparent; border-radius: 0; }
.modal-x, .x-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: none; background: transparent; font-size: 22px; font-weight: 300; line-height: 1; color: var(--dy-ink); cursor: pointer; padding: 0; border-radius: 0; flex: 0 0 auto; transition: background-color .15s var(--dy-ease); }
.modal-x:hover, .x-btn:hover { color: var(--dy-ink-strong); background: var(--dy-mist-hover); }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--dy-sea); }
.modal > :not(.modal-head):not(.modal-foot):not(.modal-body) { margin-left: 40px; margin-right: 40px; }
.modal > .modal-head + :not(.modal-body):not(.modal-foot) { margin-top: 30px; }
.modal > :last-child:not(.modal-foot):not(.modal-body):not(.modal-head) { margin-bottom: 40px; }

/* ---------- Toast (jade-800, blanc 12 Medium, carré de statut 5 px) ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.toast { background: var(--dy-jade-800); color: var(--dy-white); padding: 15px 20px; border-radius: 0; font-size: 12px; font-weight: 500; line-height: 1.3; box-shadow: none; display: flex; align-items: center; gap: 10px; animation: fade .3s var(--dy-ease); max-width: 420px; }
.toast .dot { width: 5px; height: 5px; border-radius: 0; background: var(--dy-volt); flex: 0 0 5px; }

/* ---------- Graphiques ---------- */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.legend { display: flex; gap: 15px 20px; margin-top: 15px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dy-ink); font-weight: 500; }
.legend i { width: 10px; height: 10px; border-radius: 0; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,46,50,.14); }

/* ---------- Divers ---------- */
.row-actions { display: flex; gap: 10px; align-items: center; }
.progress { height: 3px; background: var(--dy-track); border-radius: 0; overflow: hidden; display: flex; }
.progress > i { height: 100%; display: block; }
.progress > i.teal { background: var(--dy-teal); }
.progress > i.warm { background: var(--dy-sea); }
.progress > i.deep { background: var(--dy-jade-800); }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.wrap-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill-type { font-size: 10px; font-weight: 500; line-height: 1; color: var(--dy-chip-neutral-fg); background: var(--dy-chip-neutral); padding: 4px 7px 3px; border-radius: 999px; white-space: nowrap; }
.dot-status { width: 5px; height: 5px; border-radius: 0; display: inline-block; margin-right: 8px; vertical-align: middle; }
.dot-status.live { background: var(--dy-volt); box-shadow: inset 0 0 0 1px var(--dy-chip-revision-fg); }
.dot-status.done { background: var(--dy-sea); }
.empty { text-align: center; color: var(--dy-muted); padding: 50px 20px; }
.mini-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 5px; }
.mini-meta div { font-size: 12px; color: var(--dy-muted); }
.mini-meta b { color: var(--dy-ink-title); font-weight: 500; }
.search { position: relative; }
.search input { padding-left: 34px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--dy-ink); }
hr.rule { border: none; border-top: 1px solid var(--dy-sea); margin: 30px 0; }
.batch-bar { position: sticky; bottom: 20px; margin-top: 20px; background: var(--dy-jade-800); color: var(--dy-white); border: 0; border-radius: 0; box-shadow: none; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.batch-bar .btn { background: var(--dy-glass); color: var(--dy-white); }
.batch-bar .btn:hover { background: var(--dy-glass-hover); }
.batch-bar .btn.primary { background: var(--dy-white); color: var(--dy-ink); }
.batch-bar .btn.primary:hover { background: var(--dy-mint); }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; max-height: 230px; overflow: auto; padding: 5px 2px; }
.chk { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.chk input { width: 16px; height: 16px; flex: 0 0 auto; }
.seg-mini { display: inline-flex; gap: 0; background: transparent; box-shadow: var(--dy-frame); border-radius: 0; padding: 0; }
.seg-mini button { border: none; background: transparent; height: 32px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--dy-ink); border-radius: 0; cursor: pointer; transition: background-color .15s var(--dy-ease), color .15s var(--dy-ease); }
.seg-mini button:hover { background: var(--dy-mist); }
.seg-mini button.on { background: var(--dy-jade-800); color: var(--dy-white); box-shadow: none; }

/* ---------- Aperçu PDF (devis/facture Pennylane) ---------- */
.pdf-preview { background: var(--dy-white); border: 0; box-shadow: var(--dy-frame); border-radius: 0; padding: 40px; }
.pdf-top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--dy-jade-700); padding-bottom: 20px; }
.pdf-wm { font-weight: 800; font-size: 20px; letter-spacing: 0.14em; color: var(--dy-ink-title); }
.pdf-id { text-align: right; font-size: 10px; font-weight: 800; color: var(--dy-muted); text-transform: uppercase; letter-spacing: 0; line-height: 1.6; }
.pdf-id b { font-size: 16px; font-weight: 400; color: var(--dy-ink-title); }
.pdf-meta { display: flex; gap: 40px; margin: 20px 0 5px; }
.pdf-meta .eyebrow { margin-bottom: 5px; }
table.pdf-tbl { width: 100%; border-collapse: collapse; margin-top: 15px; }
table.pdf-tbl th { text-align: left; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; color: var(--dy-ink-strong); border-bottom: 1px solid var(--dy-jade-700); padding: 10px 5px; }
table.pdf-tbl th.num, table.pdf-tbl td.num { text-align: right; }
table.pdf-tbl td { padding: 12px 5px; border-bottom: 1px solid var(--dy-sea); font-variant-numeric: tabular-nums; }
.pdf-tot { margin-top: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 12px; color: var(--dy-muted); }
.pdf-tot b { color: var(--dy-ink-title); font-weight: 500; margin-left: 12px; font-variant-numeric: tabular-nums; }
.pdf-tot .grand { font-size: 16px; color: var(--dy-ink-title); font-weight: 400; margin-top: 5px; border-top: 1px solid var(--dy-jade-700); padding-top: 10px; min-width: 220px; display: flex; justify-content: space-between; }

/* ============================================================
   ESPACE CRM
   ============================================================ */
#crm { min-height: 100vh; background: var(--dy-white); display: flex; flex-direction: row; }
.crm-empty { text-align: center; max-width: 440px; margin: 80px auto 0; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.crm-empty h2 { font-size: 30px; font-weight: 300; letter-spacing: -0.02em; color: var(--dy-ink-title); }
.crm-empty p { font-size: 14px; color: var(--dy-muted); line-height: 1.5; }

/* Kanban pipeline */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 15px; align-items: start; overflow-x: auto; padding-bottom: 5px; }
.kb-col { background: var(--dy-mist); border-radius: 0; padding: 10px; min-height: 220px; transition: background-color .15s var(--dy-ease), box-shadow .15s var(--dy-ease); }
.kb-col.over { background: var(--dy-mist-hover); box-shadow: inset 0 0 0 1px var(--dy-teal); }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 5px 5px 15px; }
.kb-head .kb-name { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; color: var(--dy-ink-strong); }
.kb-head .kb-count { font-size: 10px; font-weight: 500; line-height: 1; color: var(--dy-chip-neutral-fg); background: var(--dy-white); border-radius: 999px; padding: 4px 7px 3px; }
.kb-head .kb-sum { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--dy-ink); font-variant-numeric: tabular-nums; }
.kb-cards { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.kb-card { background: var(--dy-white); border: 0; border-radius: 0; padding: 15px; cursor: grab; box-shadow: none; transition: box-shadow .15s var(--dy-ease); }
.kb-card:hover { box-shadow: var(--dy-frame-selected); }
.kb-card.dragging { opacity: .45; cursor: grabbing; }
.kb-brand { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; color: var(--dy-muted); display: flex; align-items: center; gap: 6px; }
.kb-title { font-size: 16px; font-weight: 400; letter-spacing: -0.01em; color: var(--dy-ink-title); margin: 8px 0 10px; line-height: 1.2; }
.kb-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--dy-muted); font-variant-numeric: tabular-nums; }
.kb-days { background: var(--dy-mist); border-radius: 999px; padding: 4px 7px 3px; font-size: 10px; font-weight: 500; line-height: 1; color: var(--dy-chip-neutral-fg); }
.kb-contacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.kb-chip { font-size: 10px; font-weight: 500; line-height: 1; background: var(--dy-chip-client); color: var(--dy-chip-client-fg); border-radius: 999px; padding: 4px 7px 3px; }
.kb-empty { font-size: 12px; color: var(--dy-muted); text-align: center; padding: 15px 5px; }
.kb-lostzone { margin-top: 15px; border: 1px dashed var(--dy-sea); border-radius: 0; padding: 15px; text-align: center; font-size: 12px; font-weight: 500; color: var(--dy-muted); transition: all .15s var(--dy-ease); }
.kb-lostzone.over { border-color: var(--dy-error); background: var(--dy-chip-stalled); color: var(--dy-chip-stalled-fg); }

/* Listes CRM */
#crm table.tbl th { padding: 12px 15px 10px; }
#crm table.tbl td { padding: 10px 15px; }
#crm table.tbl tbody tr:last-child td { border-bottom: 1px solid var(--dy-sea); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--dy-mist); color: var(--dy-ink-title); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex: 0 0 auto; }
.avatar-sq { width: 32px; height: 32px; border-radius: 0; background: var(--dy-jade-800); color: var(--dy-white); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.cell-main { font-weight: 400; font-size: 14px; color: var(--dy-ink-title); line-height: 1.25; }
.cell-sub { font-size: 12px; color: var(--dy-muted); margin-top: 3px; }
.chip-soft { display: inline-flex; align-items: center; gap: 5px; background: var(--dy-chip-neutral); border: 0; border-radius: 999px; padding: 4px 7px 3px; font-size: 10px; font-weight: 500; line-height: 1; color: var(--dy-chip-neutral-fg); white-space: nowrap; }
.rowchev { color: var(--dy-sea); font-size: 15px; transition: color .15s var(--dy-ease), transform .15s var(--dy-ease); display: inline-block; }
tr.click:hover .rowchev { color: var(--dy-jade-800); transform: translateX(3px); }
.search-wrap { position: relative; padding: 20px; border-bottom: 1px solid var(--dy-sea); }
.search-wrap .ico { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); color: var(--dy-ink); width: 16px; height: 16px; }
.search-wrap input { width: 100%; max-width: 420px; height: 40px; border: 0; border-bottom: 1px solid var(--dy-sea); border-radius: 0; padding: 0 12px 0 38px; font-size: 14px; color: var(--dy-ink-title); background: var(--dy-mist); }
.search-wrap input:focus { outline: none; border-bottom-color: var(--dy-jade-800); background: var(--dy-mist-hover); box-shadow: none; }
.crm-empty-list { text-align: center; padding: 50px 20px; color: var(--dy-muted); font-size: 14px; }
.crm-empty-list .hub-ico { margin: 0 auto 15px; }

/* Flow builder (arbre de nœuds Oui / Non) */
.af-canvas { display: flex; flex-direction: column; align-items: center; padding: 30px 0 60px; overflow-x: auto; background: var(--dy-mist); }
.af-node { position: relative; background: var(--dy-white); border: 0; border-radius: 0; padding: 15px 40px 15px 20px; min-width: 260px; max-width: 340px; box-shadow: none; cursor: pointer; font-size: 14px; color: var(--dy-ink); transition: box-shadow .15s var(--dy-ease); }
.af-node:hover { box-shadow: var(--dy-frame); }
.af-node b { font-size: 14px; font-weight: 500; color: var(--dy-ink-title); }
.af-nhead { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; color: var(--dy-muted); margin-bottom: 8px; }
.af-trigger { background: var(--dy-jade-800); color: var(--dy-white); cursor: default; min-width: 320px; }
.af-trigger b { color: var(--dy-white); }
.af-trigger .af-nhead { color: var(--dy-sea); }
.af-wait { box-shadow: inset 3px 0 0 var(--dy-volt); }
.af-split { box-shadow: inset 3px 0 0 var(--dy-sea); }
.af-action { box-shadow: inset 3px 0 0 var(--dy-teal); }
.af-wait:hover, .af-split:hover, .af-action:hover { background: var(--dy-row-hover); }
.af-x { position: absolute; top: 8px; right: 8px; border: none; background: transparent; color: var(--dy-muted); font-size: 15px; cursor: pointer; border-radius: 0; padding: 2px 5px; }
.af-x:hover { color: var(--dy-danger); background: var(--dy-mist); }
.af-wire { width: 1px; height: 20px; background: var(--dy-sea); }
.af-plus { width: 24px; height: 24px; border-radius: 0; border: 0; box-shadow: var(--dy-frame); background: var(--dy-white); color: var(--dy-ink); font-size: 15px; font-weight: 300; cursor: pointer; line-height: 1; transition: background-color .15s var(--dy-ease); }
.af-plus:hover { background: var(--dy-jade-800); color: var(--dy-white); box-shadow: none; }
.af-end { font-size: 10px; font-weight: 500; line-height: 1; letter-spacing: 0; text-transform: none; color: var(--dy-chip-neutral-fg); background: var(--dy-white); border-radius: 999px; padding: 4px 10px 3px; margin-top: 10px; }
.af-branches { display: flex; gap: 40px; align-items: flex-start; margin-top: 15px; }
.af-branch { display: flex; flex-direction: column; align-items: center; min-width: 270px; }
.af-blabel { font-size: 10px; font-weight: 500; line-height: 1; letter-spacing: 0; text-transform: none; border-radius: 999px; padding: 4px 10px 3px; margin-bottom: 3px; }
.af-blabel.oui { background: var(--dy-chip-progress); color: var(--dy-chip-progress-fg); }
.af-blabel.non { background: var(--dy-chip-stalled); color: var(--dy-chip-stalled-fg); }

/* Automations */
.auto-node { display: inline-flex; align-items: center; gap: 5px; background: var(--dy-mist); border: 0; border-radius: 0; height: 32px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--dy-ink); }
.auto-arrow { color: var(--dy-sea); font-size: 13px; font-weight: 400; }
.auto-flow { display: flex; flex-direction: column; }
.auto-card { border: 0; box-shadow: var(--dy-frame); border-radius: 0; padding: 20px; background: var(--dy-white); }
.auto-connector { text-align: center; color: var(--dy-muted); font-size: 12px; font-weight: 500; padding: 8px 0; }

/* Builder email (canvas + palette) */
.cvb { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.cvb-canvas { background: var(--dy-mist); border-radius: 0; padding: 30px 20px; min-height: 480px; display: flex; justify-content: center; overflow-x: auto; }
.cvb-mail { background: var(--dy-white); border-radius: 0; padding: 34px 38px; box-shadow: none; max-width: 100%; transition: width .3s var(--dy-ease); }
.cvb-block { position: relative; border: 1px dashed transparent; border-radius: 0; padding: 2px 6px; margin: 0 -6px; }
.cvb-block:hover { border-color: var(--dy-sea); }
.cvb-block.sel { border: 1px solid var(--dy-teal); background: transparent; }
.cvb-block.over { border-top: 2px solid var(--dy-teal); }
.cvb-handle { position: absolute; top: -21px; left: -1px; display: none; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; color: var(--dy-white); background: var(--dy-jade-800); border: 0; border-radius: 0; padding: 4px 8px; cursor: grab; z-index: 3; align-items: center; gap: 8px; line-height: 1; }
.cvb-block:hover .cvb-handle, .cvb-block.sel .cvb-handle { display: inline-flex; }
.cvb-tools button { border: none; background: transparent; color: var(--dy-sea); font-size: 12px; padding: 0 2px; cursor: pointer; }
.cvb-tools button:hover { color: var(--dy-white); }
.cvb-drop { border: 1px dashed var(--dy-teal); background: var(--dy-mist-hover); border-radius: 0; padding: 34px; text-align: center; color: var(--dy-ink); font-size: 14px; font-weight: 500; }
.cvb-side { position: sticky; top: 15px; }
.cvb-tabs { display: flex; gap: 30px; padding: 0 20px; border-bottom: 1px solid var(--dy-sea); }
.cvb-tabs button { position: relative; flex: 0 0 auto; border: none; background: transparent; padding: 20px 0 12px; font-size: 12px; font-weight: 500; line-height: 1; color: var(--dy-ink); border-bottom: 0; cursor: pointer; }
.cvb-tabs button:hover { color: var(--dy-ink-strong); }
.cvb-tabs button.on { color: var(--dy-ink-strong); }
.cvb-tabs button.on::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 3px; height: 3px; margin-left: -1.5px; background: currentColor; }
.cvb-pal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 20px; }
.cvb-pal-card { display: flex; flex-direction: column; align-items: center; gap: 10px; border: 0; border-radius: 0; padding: 20px 5px 15px; font-size: 12px; font-weight: 500; color: var(--dy-ink); cursor: grab; background: var(--dy-mist); transition: background-color .15s var(--dy-ease); }
.cvb-pal-card:hover { background: var(--dy-mist-hover); }
.cvb-pal-card .ico { width: 18px; height: 18px; color: var(--dy-ink-title); }
.cvb-panel .field { margin-bottom: 15px; }
.cvb-panel textarea, .cvb-panel input, .cvb-panel select { width: 100%; }

/* Timeline (fiches) */
.tl { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--dy-sea); font-size: 14px; }
.tl-item:last-child { border-bottom: none; }
.tl-ico { width: 28px; height: 28px; border-radius: 0; background: var(--dy-mist); color: var(--dy-ink); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tl-ico .ico { width: 14px; height: 14px; }
.tl-body { flex: 1; min-width: 0; }
.tl-date { font-size: 12px; color: var(--dy-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============================================================
   ASSISTANT, RECHERCHE, NOTIFICATIONS
   ============================================================ */
#chatFab { position: fixed; right: 20px; bottom: 20px; width: 50px; height: 50px; border-radius: 0; border: none; background: var(--dy-grad-cta); color: var(--dy-white); font-size: 20px; cursor: pointer; box-shadow: none; z-index: 900; transition: filter .15s var(--dy-ease); }
#chatFab:hover { transform: none; filter: brightness(1.1); }
#chatPanel { position: fixed; right: 20px; bottom: 80px; width: 400px; max-width: calc(100vw - 30px); height: 540px; max-height: calc(100vh - 120px); background: var(--dy-white); border-radius: 0; box-shadow: var(--dy-frame); display: none; flex-direction: row; overflow: hidden; z-index: 901; }
#chatPanel .chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#chatPanel .chat-head { background: var(--dy-jade-800); color: var(--dy-white); height: 56px; padding: 0 20px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
#chatPanel .chat-head button { color: var(--dy-sea); }
#chatPanel .chat-head button:hover { color: var(--dy-white); }
#chatPanel .chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--dy-white); }
#chatPanel .chat-msg { max-width: 88%; padding: 12px 15px; border-radius: 0; font-size: 14px; line-height: 1.45; }
#chatPanel .chat-msg.user { align-self: flex-end; background: var(--dy-jade-800); color: var(--dy-white); }
#chatPanel .chat-msg.assistant { align-self: flex-start; background: var(--dy-mist); color: var(--dy-ink); border: 0; }
#chatPanel .chat-foot { display: flex; gap: 10px; padding: 15px 20px; border-top: 1px solid var(--dy-sea); align-items: center; }
#chatPanel .chat-foot input { flex: 1; height: 40px; border: 0; border-bottom: 1px solid var(--dy-sea); border-radius: 0; padding: 0 12px; font-size: 14px; background: var(--dy-mist); color: var(--dy-ink-title); outline: none; }
#chatPanel .chat-foot input:focus { border-bottom-color: var(--dy-jade-800); }
#chatPanel.big { width: min(1060px, 94vw); height: min(86vh, 920px); }
#chatPanel.big .chat-msg { max-width: 76%; }
#chatSide { display: none; width: 240px; min-width: 240px; border-right: 1px solid var(--dy-sea); flex-direction: column; background: var(--dy-row-hover); }
.chat-thread { height: 40px; padding: 0 20px; display: flex; align-items: center; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--dy-sea); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dy-ink); }
.chat-thread:hover { background: var(--dy-mist); }
.chat-thread.sel { background: var(--dy-mist); box-shadow: var(--dy-frame-selected); font-weight: 500; color: var(--dy-ink-title); }
.chat-attbar { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 20px; }
.chat-attbar:not(:empty) { padding: 10px 20px 0; }
.chat-chip { background: var(--dy-chip-neutral); color: var(--dy-chip-neutral-fg); border: 0; border-radius: 999px; padding: 4px 8px 3px; font-size: 10px; font-weight: 500; }
.chat-clip { cursor: pointer; font-size: 17px; align-self: center; padding: 0 2px; color: var(--dy-ink); }

/* Recherche globale (Ctrl+K) */
#palette { display: none; position: fixed; inset: 0; background: var(--dy-overlay); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); z-index: 950; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.pal-box { background: var(--dy-white); border-radius: 0; width: min(640px, 92vw); box-shadow: none; overflow: hidden; }
.pal-box input { width: 100%; border: none; outline: none; padding: 20px; font-size: 20px; font-weight: 300; letter-spacing: -0.02em; color: var(--dy-ink-title); border-bottom: 1px solid var(--dy-sea); }
#palRes { max-height: 52vh; overflow-y: auto; padding: 0; }
.pal-item { display: flex; justify-content: space-between; align-items: center; gap: 15px; height: 44px; padding: 0 20px; border-radius: 0; border-bottom: 1px solid var(--dy-sea); font-size: 14px; cursor: pointer; }
.pal-item:hover { background: var(--dy-row-hover); }
.pal-item.sel { background: var(--dy-mist); box-shadow: var(--dy-frame-selected); }
.pal-sub { font-size: 12px; color: var(--dy-muted); white-space: nowrap; }

/* Notifications (cloche dans la barre du haut) */
#notifFab { position: relative; right: auto; bottom: auto; width: 40px; height: 40px; border-radius: 0; border: 0; background: transparent; font-size: 15px; cursor: pointer; box-shadow: none; margin-right: 5px; flex: none; color: var(--dy-ink); transition: background-color .15s var(--dy-ease); }
#notifFab:hover { background: var(--dy-mist-hover); }
#notifBadge { position: absolute; top: 4px; right: -2px; background: var(--dy-volt); color: var(--dy-jade-900); font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 0; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; }
#notifPanel { display: none; position: fixed; right: 40px; top: 80px; bottom: auto; width: 380px; max-width: calc(100vw - 30px); max-height: 60vh; background: var(--dy-white); border-radius: 0; box-shadow: var(--dy-frame); flex-direction: column; overflow: hidden; z-index: 900; }
.notif-item { padding: 15px 20px; border-bottom: 1px solid var(--dy-sea); font-size: 14px; line-height: 1.4; cursor: pointer; color: var(--dy-ink); }
.notif-item:hover { background: var(--dy-row-hover); }
.notif-item.unread { background: var(--dy-mist); box-shadow: var(--dy-frame-selected); font-weight: 500; color: var(--dy-ink-title); }

/* Bouton recherche dans la barre du haut */
#searchBtn { display: inline-flex; align-items: center; gap: 10px; height: 40px; border: 0; background: var(--dy-mist); border-radius: 0; padding: 0 15px; font-size: 12px; font-weight: 500; color: var(--dy-ink); cursor: pointer; margin-right: 5px; flex: none; transition: background-color .15s var(--dy-ease); }
#searchBtn:hover { background: var(--dy-mist-hover); }
#searchBtn kbd { font-family: inherit; font-size: 10px; font-weight: 500; background: var(--dy-white); border: 0; border-radius: 0; padding: 3px 5px; color: var(--dy-ink); line-height: 1; }
@media (max-width: 1100px) { #searchBtn .sb-hint, #searchBtn kbd { display: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-2, .grid-2.even, .grid-3 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 20px; padding-right: 20px; }
  .page-title { font-size: 30px; letter-spacing: -0.02em; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .field-row { grid-template-columns: 1fr; }
}
