/* Bureau (≥ 721px) — mise en page « deux panneaux » de la planche DK.
   Chargé après da.css sur toutes les pages. Mobile inchangé : tout est dans
   @media (min-width: 721px). Primitives partagées d'abord, puis une section par page. */

@media (min-width: 721px) {
  /* ---------- Primitives ---------- */
  .page { max-width: none; padding: 4px var(--dk-pad) 32px; }
  .page h1 { font-size: 48px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; margin: 0; }
  .page__subtitle { margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--color-text-muted); }

  .dk-lbl { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
  .dk-card { background: var(--color-surface); border-radius: 28px; padding: 22px; }
  .dk-card__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
  .dk-card__head h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-card__head a { font-size: 13px; font-weight: 700; color: var(--color-accent-hover); text-decoration: none; }
  .dk-pills { display: flex; flex-wrap: wrap; gap: 8px; }
  .dk-pill { display: inline-block; padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--txt-encre); }
  .dk-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px;
    border: 0; border-radius: 999px; background: var(--color-surface); color: var(--color-text);
    font: 700 14px var(--font-sans); cursor: pointer; text-decoration: none;
  }
  .dk-btn--accent { background: var(--color-accent); color: var(--color-accent-contrast); }
  .dk-btn--ink { background: var(--color-ink); color: var(--color-ink-contrast); }

  /* ---------- DK-2 Agenda : mois à gauche, détail du jour à droite ---------- */
  .dk-cal { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .dk-cal__main { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 14px; align-content: start; min-width: 0; }
  .dk-cal__main > .page__header { grid-column: 1; grid-row: 1; margin: 0; padding: 6px 4px 0; }
  .dk-cal__main > .cal-controls { grid-column: 2; grid-row: 1; margin: 0; align-self: center; flex-wrap: nowrap; }
  .dk-cal__main > #cal-container { grid-column: 1 / -1; grid-row: 2; }
  .dk-cal__main > .cal-activite,
  .dk-cal__main > .cal-legend,
  .dk-cal__main > .cal-density-legend { display: none; }
  .dk-cal #cal-new-btn { display: none; }
  .dk-cal .cal-controls .tabs { background: var(--color-surface); padding: 5px; border-radius: 999px; }
  .dk-cal .cal-controls .tabs button { min-height: 38px; padding: 0 18px; font-size: 13px; font-weight: 600; border-radius: 999px; }
  .dk-cal .cal-controls .tabs button.active { background: var(--color-ink); color: var(--color-ink-contrast); font-weight: 700; box-shadow: none; }
  .dk-cal__nav { width: 46px; height: 46px; border: 0; border-radius: 999px; background: var(--color-surface); color: var(--color-text); font: 700 24px/1 var(--font-sans); cursor: pointer; }
  .dk-cal .cal-controls .circle-btn--sm { display: none; }

  .dk-cal #cal-container { background: var(--color-surface); border-radius: 28px; padding: 18px; min-height: 560px; }
  .dk-cal .cal-month__weekdays { border: 0; gap: 8px; margin-bottom: 10px; }
  .dk-cal .cal-month__weekdays span { padding: 0; text-align: center; font-size: 11px; letter-spacing: 0.06em; }
  .dk-cal .cal-month__grid { gap: 8px; grid-auto-rows: minmax(76px, 1fr); }
  .dk-cal .cal-month__day {
    border: 0; border-radius: 18px; background: var(--color-surface-hollow); padding: 10px 12px;
    justify-content: space-between; font-size: 15px; font-weight: 700; overflow: hidden;
  }
  .dk-cal .cal-month__day.is-other-month { background: transparent; color: var(--color-text-faint); }
  .dk-cal .cal-month__day--n1, .dk-cal .cal-month__day--n2, .dk-cal .cal-month__day--n3 { background: var(--color-surface-hollow); }
  .dk-cal .cal-month__day.is-today { background: var(--pastel-lime); color: var(--txt-encre); font-weight: 800; --txt-encre: #1B1A17; }
  .dk-cal .cal-month__day.is-selected { box-shadow: inset 0 0 0 2px var(--color-ink); }
  .dk-cal .cal-month__day-number, .dk-cal .cal-month__day.is-today .cal-month__day-number {
    width: auto; height: auto; background: none; box-shadow: none; color: inherit; font-size: 15px; font-weight: inherit; display: block;
  }
  .cal-dots { display: flex; gap: 4px; flex-wrap: wrap; min-height: 9px; }
  .cal-dots .cal-chip { width: 9px; height: 9px; padding: 0; border-radius: 50%; display: block; cursor: grab; }

  .dk-cal__side { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 640px; }
  .dk-cal__side-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 6px 4px 0; }
  .dk-cal__side-head h2 { margin: 8px 0 0; font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; }
  .dk-cal__evs { display: flex; flex-direction: column; gap: 14px; }
  .dk-ev { display: flex; gap: 14px; align-items: stretch; }
  .dk-ev__t { width: 54px; padding-top: 16px; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; flex: none; }
  .dk-ev__c {
    flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
    padding: 16px 20px; border: 0; border-radius: 24px; background: var(--cat); color: var(--txt-encre); font-family: inherit; cursor: pointer;
  }
  .dk-ev__c b { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
  .dk-ev__c span { font-size: 13px; opacity: 0.7; }
  .dk-cal__cats { margin-top: auto; }
}


@media (min-width: 721px) {
  /* ---------- Maître / détail générique (clients, devis, factures, projets…) ---------- */
  .dk-split { display: grid; grid-template-columns: var(--dk-cols, minmax(0, 1fr) minmax(0, 1.2fr)); gap: 20px; align-items: start; }
  .dk-split__list { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .dk-split__detail { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: sticky; top: 8px; }
  .dk-split__list > .page__header { margin: 0; padding: 6px 4px 0; }
  .dk-split__list .page__title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

  .dk-pill--ink { background: var(--color-ink); color: var(--color-ink-contrast); }
  .dk-pill--glass { background: rgba(255, 255, 255, 0.6); color: var(--txt-encre); }
  .dk-tag { font-style: normal; border-radius: 999px; padding: 3px 9px; font-size: 11px; margin-left: 6px; color: var(--txt-encre); }
  .dk-av { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 16px; font-weight: 800; font-size: 15px; flex: none; }
  .dk-av--xl { width: 72px; height: 72px; border-radius: 24px; background: #1B1A17; color: #D7F25C; font-size: 26px; }
  .dk-hero { display: flex; align-items: center; gap: 18px; border-radius: 36px; padding: 26px 28px; color: var(--txt-encre); }
  .dk-hero--lime { background: var(--pastel-lime); --txt-encre: #1B1A17; }
  .dk-hero--lilas { background: var(--pastel-lilas); --txt-encre: #1B1A17; }
  .dk-hero--orange { background: var(--pastel-orange); --txt-encre: #1B1A17; }
  .dk-hero--menthe { background: var(--pastel-menthe); --txt-encre: #1B1A17; }
  .dk-hero > div { flex: 1; min-width: 0; }
  .dk-hero h2 { margin: 0 0 10px; font-size: 38px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; }
  .dk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .dk-stats .dk-card { padding: 18px 20px; }
  .dk-stats .dk-card span { display: block; font-size: 12px; font-weight: 700; color: var(--color-text-muted); }
  .dk-stats .dk-card b { display: block; margin-top: 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
  .dk-card--lilas { background: var(--pastel-lilas); color: var(--txt-encre); --txt-encre: #1B1A17; }
  .dk-card--lilas span { color: var(--txt-encre) !important; }
  .dk-card--ink { background: var(--dk-ink-surface, #1B1A17); color: #fff; }
  .dk-card--ink span { color: #C9C6BC !important; }
  .dk-card--orange { background: var(--pastel-orange); color: var(--txt-encre); --txt-encre: #1B1A17; }
  .dk-card--lime { background: var(--pastel-lime); color: var(--txt-encre); --txt-encre: #1B1A17; }
  .dk-card--menthe { background: var(--pastel-menthe); color: var(--txt-encre); --txt-encre: #1B1A17; }
  .dk-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .dk-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-card__head h3 { margin: 0; }
  .dk-kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--color-bg); font-size: 14px; }
  .dk-kv span:first-child { color: var(--color-text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dk-kv span:last-child { font-weight: 700; text-align: right; white-space: nowrap; }

  /* ---------- DK-4 Clients ---------- */
  .dk-split--clients { --dk-cols: minmax(0, 1fr) minmax(0, 1.2fr); }
  .dk-split--clients .page__title-row .circle-btn { width: auto; height: 46px; padding: 0 22px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-contrast); font-size: 14px; font-weight: 700; }
  .dk-split--clients .page__title-row .circle-btn::after { content: '+ Nouveau contact'; }
  .dk-split--clients .page__title-row .circle-btn svg { display: none; }
  .dk-split--clients .page__subtitle { display: none; }
  .dk-split--clients .tabs { background: var(--color-surface); padding: 5px; border-radius: 999px; width: fit-content; margin: 0; }
  .dk-split--clients .tabs button { min-height: 38px; padding: 0 20px; border-radius: 999px; font-size: 13px; font-weight: 600; }
  .dk-split--clients .tabs button.active { background: var(--color-ink); color: var(--color-ink-contrast); font-weight: 700; box-shadow: none; }
  .dk-split--clients .form-field { margin: 0; max-width: none; }
  .dk-split--clients input[type='search'] { background: var(--color-surface); border: 0; border-radius: 999px; min-height: 48px; padding: 0 18px; }
  .dk-split--clients .client-row { border-radius: 24px; padding: 14px 18px; background: var(--color-surface); }
  .dk-split--clients .client-row.is-selected { box-shadow: inset 0 0 0 3px var(--color-ink); }
  .dk-split--clients .client-row__contact,
  .dk-split--clients .client-row .circle-btn { display: none; }
  .dk-split--clients .streak-card { order: 9; margin-top: auto; }
}

@media (max-width: 720px) {
  .dk-cal__side, .dk-cal__nav, .dk-split__detail { display: none; }
}
@media (min-width: 721px) {
  .dk-split__list > .page__header > div { flex: 1; }
}

@media (min-width: 721px) {
  /* ---------- Briques partagées : bandeau chiffre, en-tête de panneau, document ---------- */
  .dk-hero--stat { justify-content: space-between; align-items: flex-end; border-radius: 32px; padding: 24px 26px; }
  .dk-hero--stat > div:first-child { flex: none; }
  .dk-hero__lbl { display: block; font-size: 13px; font-weight: 700; }
  .dk-hero--stat b { display: block; margin-top: 8px; font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; }
  .dk-hero--stat .dk-pills { flex: none; gap: 6px; flex-wrap: nowrap; }
  .dk-hero--stat .dk-pill { padding: 6px 12px; white-space: nowrap; }

  .dk-side-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 6px 4px 0; }
  .dk-side-head h2 { margin: 8px 0 0; font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; }
  .dk-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

  .dk-doc { display: flex; flex-direction: column; gap: 14px; }
  .dk-steps { display: flex; gap: 6px; }
  .dk-step { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 13px; }
  .dk-step:last-child { flex: none; }
  .dk-step i { width: 28px; height: 28px; border-radius: 50%; background: var(--pastel-sable-fonce); color: var(--txt-encre); display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 13px; font-weight: 800; flex: none; --txt-encre: #1B1A17; }
  .dk-step.is-done i { background: var(--pastel-lime); --txt-encre: #1B1A17; }
  .dk-step.is-now i { background: var(--color-ink); color: var(--color-ink-contrast); }
  .dk-step:not(.is-done) b { color: var(--color-text-muted); }
  .dk-step span { flex: 1; height: 3px; border-radius: 3px; background: var(--pastel-sable-fonce); --txt-encre: #1B1A17; }
  .dk-step.is-done:not(.is-now) span { background: var(--pastel-lime); --txt-encre: #1B1A17; }
  .dk-doc__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 6px; }
  .dk-doc__meta b { display: block; margin-top: 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
  .dk-doc__meta small { display: block; margin-top: 2px; font-size: 13px; color: var(--color-text-muted); }
  .dk-right { text-align: right; }
  .dk-lines { margin-top: 8px; }
  .dk-ln { display: grid; grid-template-columns: minmax(0, 1fr) 50px 90px 90px; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--color-bg); font-size: 14px; }
  .dk-ln small { display: block; font-size: 12px; color: var(--color-text-muted); font-weight: 400; }
  .dk-ln span:nth-child(n + 2) { text-align: right; }
  .dk-ln--head { border: 0; font-size: 12px; font-weight: 700; color: var(--color-text-muted); padding-bottom: 6px; }
  .dk-total { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-radius: 22px; background: var(--dk-ink-surface, #1B1A17); color: #fff; }
  .dk-total span { display: block; font-size: 12px; font-weight: 700; color: #C9C6BC; }
  .dk-total small { display: block; margin-top: 2px; font-size: 12px; color: #C9C6BC; }
  .dk-total b { font-size: 40px; font-weight: 800; letter-spacing: -0.05em; color: var(--pastel-lime); }

  /* Lignes de liste « document » (devis, factures) */
  .dk-split--devis .cards, .dk-split--factures .cards { display: flex; flex-direction: column; gap: 10px; }
  .dk-split--devis .tile, .dk-split--factures .tile { border-radius: 24px; padding: 16px 20px; background: var(--color-surface); }
  .dk-split--devis .tile.is-selected, .dk-split--factures .tile.is-selected { box-shadow: inset 0 0 0 3px var(--color-ink); }
  .dk-split--devis .page__title-row, .dk-split--factures .page__title-row { justify-content: space-between; }
  .dk-split--devis .page__subtitle, .dk-split--factures .page__subtitle { display: none; }
  .dk-split--devis .circle-btn--primary, .dk-split--factures .circle-btn--primary { width: auto; height: 46px; padding: 0 22px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-contrast); font-size: 14px; font-weight: 700; }
  .dk-split--devis .circle-btn--primary svg, .dk-split--factures .circle-btn--primary svg { display: none; }
  .dk-split--devis #btn-new::after { content: '+ Nouveau devis'; }
  .dk-split--factures #btn-new::after { content: '+ Nouvelle facture'; }
  .dk-split--devis .tabs, .dk-split--factures .tabs { background: var(--color-surface); padding: 5px; border-radius: 999px; width: fit-content; margin: 0; }
  .dk-split--devis .tabs button, .dk-split--factures .tabs button { min-height: 38px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 600; }
  .dk-split--devis .tabs button.active, .dk-split--factures .tabs button.active { background: var(--color-ink); color: var(--color-ink-contrast); font-weight: 700; box-shadow: none; }
  .dk-split--devis { --dk-cols: minmax(0, 1fr) minmax(0, 1.1fr); }
  .dk-split--factures { --dk-cols: minmax(0, 1.1fr) minmax(0, 1fr); }
}
@media (min-width: 721px) {
  .dk-split--devis .tile, .dk-split--factures .tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: center; }
  .dk-split--devis .tile > *, .dk-split--factures .tile > * { grid-column: 1; }
  .dk-split--devis .tile .tile__footer, .dk-split--factures .tile .tile__footer { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 6px; margin: 0; }
  .dk-split--devis .tile__value, .dk-split--factures .tile__value { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-split--devis .tile__title, .dk-split--factures .tile__title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
}
@media (min-width: 721px) {
  .dk-split--solo { grid-template-columns: minmax(0, 1fr); }
  .dk-split--solo .dk-split__detail { display: none; }
  .dk-btn--soft { background: var(--color-bg); }
  .dk-fiche { display: flex; flex-direction: column; gap: 2px; }
  .dk-fiche__top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
  .dk-fiche__top > div { flex: 1; min-width: 0; }
  .dk-fiche__top b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-fiche__top small { display: block; font-size: 13px; color: var(--color-text-muted); }
  .dk-fiche__top strong { font-size: 34px; font-weight: 800; letter-spacing: -0.05em; }
  .dk-lbl--sub { text-transform: none; letter-spacing: 0; font-size: 13px; margin: 14px 0 4px; }
  .dk-tl { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; }
  .dk-tl i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
  .dk-tl span { color: var(--color-text-muted); }
  .dk-actions--bottom { margin-top: auto; padding-top: 14px; justify-content: flex-start; }
  .dk-split--factures .yearchart { border-radius: 32px; }
}
@media (min-width: 721px) {
  .dk-split--factures #btn-new::after { content: none; }
  .dk-split--factures #btn-new-facture::after { content: '+ Nouvelle facture'; }
  .dk-split--factures #btn-new-abonnement::after { content: '+ Nouvel abonnement'; }
  .dk-split--factures .yearchart--large { min-height: 0; height: 190px; }
  .dk-split--factures .yearchart__total { font-size: 44px; }
}

/* ---------- Connexion / Configuration (DK-16, DK-17) ---------- */
.dk-auth__left, .dk-auth__head, .dk-auth__foot { display: none; }

@media (min-width: 721px) {
  .auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 20px; min-height: 100vh; align-items: stretch; justify-items: stretch; }
  .dk-auth__left {
    display: flex; flex-direction: column; justify-content: space-between; border-radius: 44px; padding: 48px 56px; color: var(--txt-encre); overflow: hidden;
  }
  .dk-auth__left--lime { background: var(--pastel-lime); --txt-encre: #1B1A17; }
  .dk-auth__left--lilas { background: var(--pastel-lilas); --txt-encre: #1B1A17; }
  .dk-auth__brand { display: flex; align-items: center; gap: 16px; }
  .dk-auth__logo { position: relative; width: 76px; height: 76px; border-radius: 26px; background: #1B1A17; color: #D7F25C; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; letter-spacing: -0.05em; padding-bottom: 6px; }
  .dk-auth__logo::after { content: ''; position: absolute; right: 15px; bottom: 17px; width: 8px; height: 8px; border-radius: 50%; background: #6B4EFF; }
  .dk-auth__wm { font-size: 30px; font-weight: 800; letter-spacing: -0.05em; }
  .dk-auth__wm i { font-style: normal; color: #6B4EFF; }
  .dk-auth__kicker { font-size: 14px; font-weight: 700; letter-spacing: 0.06em; color: rgba(27, 26, 23, 0.6); }
  .dk-auth__title { margin-top: 14px; font-size: clamp(64px, 7.8vw, 112px); line-height: 0.9; font-weight: 800; letter-spacing: -0.06em; }
  .dk-auth__title--md { font-size: clamp(56px, 6.6vw, 96px); line-height: 0.92; }
  .dk-auth__chips { display: flex; gap: 10px; flex-wrap: wrap; }
  .dk-auth__chips span { background: rgba(255, 255, 255, 0.55); border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 700; }
  .dk-auth__chips .is-ink { background: #1B1A17; color: #fff; }
  .dk-auth__steps { display: flex; flex-direction: column; gap: 14px; }
  .dk-auth__steps > div { display: flex; align-items: center; gap: 14px; font-size: 17px; font-weight: 700; }
  .dk-auth__steps .is-off { opacity: 0.6; }
  .dk-auth__steps i { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 14px; font-weight: 800; flex: none; }
  .dk-auth__steps i.is-on { background: #1B1A17; color: #D7F25C; }

  .auth-shell .auth-card { align-self: center; justify-self: center; width: 440px; max-width: 100%; background: none; box-shadow: none; padding: 0; animation: none; }
  .auth-shell .auth-logo, .auth-shell .auth-card > h1, .auth-shell .auth-subtitle { display: none; }
  .dk-auth__head { display: block; margin-bottom: 18px; }
  .dk-auth__h { font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; }
  .dk-auth__sub { margin-top: 10px; font-size: 15px; color: var(--color-text-muted); }
  .dk-auth__foot { display: block; margin-top: 22px; text-align: center; font-size: 12px; font-weight: 500; color: var(--color-text-muted); }
}

/* ---------- Deux colonnes génériques (Conformité, Rappels, Paramètres) ---------- */
@media (min-width: 721px) {
  .dk-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .dk-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .dk-two .fiche-retour { display: none; }
  .dk-two .page__header { margin: 0; padding: 6px 4px 0; }
  .dk-col > h2, .dk-col > .u-note, .dk-col > p { margin-left: 4px; margin-right: 4px; }
  .dk-col > h2 { margin-bottom: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-card--rules { background: var(--color-surface); border-radius: 28px; padding: 22px; margin-top: 62px; }
  .dk-card--rules > h2 { margin: 0; }
}

/* ---------- DK-3 Suivi : avancement à gauche, historique Copilote à droite ---------- */
@media (min-width: 721px) {
  .dk-suivi { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px 20px; align-items: start; }
  .dk-suivi > .page__header { grid-column: 1; grid-row: 1; margin: 0; padding: 6px 4px 0; }
  .dk-suivi > #suivi-tabs { display: none; }
  .dk-suivi > #tab-avancement { grid-column: 1; grid-row: 2; display: block !important; }
  .dk-suivi > #tab-conversations,
  .dk-suivi > #tab-conversations[hidden] { grid-column: 2; grid-row: 1 / span 2; display: block !important; background: var(--color-surface); border-radius: 28px; padding: 22px; min-height: 640px; }
  .dk-suivi > #tab-avancement > h2 { display: none; }
  .dk-suivi .page__title-row { justify-content: space-between; }
  .dk-suivi .page__title-row .circle-btn--primary { width: auto; height: 46px; padding: 0 22px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-contrast); font-size: 14px; font-weight: 700; }
  .dk-suivi .page__title-row .circle-btn--primary svg { display: none; }
  .dk-suivi #btn-new-tache::after { content: '+ Nouvelle tâche'; }
}

@media (min-width: 721px) {
  .auth-card .form-field label { text-align: left; }
}

/* Bouton d'action de titre : pastille ronde « + » sur mobile, pilule libellée sur bureau
   (le libellé vient de l'aria-label, ex. « + Nouveau rappel »). */
@media (min-width: 721px) {
  .page__header > div { flex: 1; }
  .page__title-row { justify-content: space-between; }
  .page__title-row .circle-btn--primary { width: auto; height: 46px; padding: 0 22px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-contrast); font: 700 14px var(--font-sans); }
  .page__title-row .circle-btn--primary svg { display: none; }
  .page__title-row .circle-btn--primary::after { content: '+ ' attr(aria-label); }
  .dk-split--clients .page__title-row .circle-btn::after,
  .dk-split--devis #btn-new::after,
  .dk-split--factures #btn-new-facture::after,
  .dk-split--factures #btn-new-abonnement::after,
  .dk-suivi #btn-new-tache::after { content: '+ ' attr(aria-label); }
}

/* ---------- DK-15 Paramètres ---------- */
.dk-only-desktop, .dk-identity { display: none; }
@media (min-width: 721px) {
  .dk-only-desktop { display: block; }
  .dk-col.dk-only-desktop { display: flex; }
  .dk-identity { display: flex; align-items: center; gap: 18px; padding: 24px 26px; border-radius: 32px; background: var(--pastel-lilas); color: var(--txt-encre); --txt-encre: #1B1A17; }
  .dk-identity__av { width: 76px; height: 76px; border-radius: 50%; background: #1B1A17; color: var(--pastel-lilas); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; flex: none; }
  .dk-identity > div { flex: 1; min-width: 0; }
  .dk-identity b { display: block; font-size: 30px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; }
  .dk-identity small { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; color: #3F3770; }
  .dk-params .icon-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .dk-pref { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--color-bg); }
  .dk-pref > div { flex: 1; }
  .dk-pref b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
  .dk-pref small, .dk-apparence small { display: block; font-size: 13px; color: var(--color-text-muted); }
  .dk-apparence { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
  .dk-apparence--bas { margin-top: 18px; }
  .dk-seg { display: flex; padding: 4px; border-radius: 999px; background: var(--color-bg); }
  .dk-seg button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--color-text-muted); font: 700 13px var(--font-sans); cursor: pointer; }
  .dk-seg button.on { background: var(--color-ink); color: var(--color-ink-contrast); }
  .dk-btn--danger { background: var(--pastel-orange-clair); color: #8A2A0C; --txt-encre: #1B1A17; }
  .dk-card--apparence { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
}

/* ---------- DK-9 Comptabilité : chiffres à gauche, charges / calendrier à droite ---------- */
@media (min-width: 721px) {
  .dk-compta { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px 20px; align-items: start; }
  .dk-compta > .page__header { grid-column: 1; grid-row: 1; margin: 0; padding: 6px 4px 0; align-items: flex-start; }
  .dk-compta > #compta-tabs { grid-column: 2; grid-row: 1; align-self: center; justify-self: end; margin: 0; background: var(--color-surface); padding: 5px; border-radius: 999px; }
  .dk-compta > #compta-tabs button { min-height: 38px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 600; }
  .dk-compta > #compta-tabs button.active { background: var(--color-ink); color: var(--color-ink-contrast); font-weight: 700; box-shadow: none; }
  .dk-compta > #compta-tabs [data-tab='chiffres'] { display: none; }
  .dk-compta > #tab-chiffres { grid-column: 1; grid-row: 2; display: block !important; }
  .dk-compta > #tab-charges, .dk-compta > #tab-calendrier { grid-column: 2; grid-row: 2; background: var(--color-surface); border-radius: 28px; padding: 22px; }
  .dk-compta #tab-chiffres .u-section { display: none; }
  .dk-compta .page__header .form-field { margin: 0; width: 120px; flex: none; }
}

/* ---------- DK-8 Administratif ---------- */
@media (min-width: 721px) {
  .dk-split--admin { --dk-cols: minmax(0, 1fr) minmax(0, 1.1fr); }
  .dk-hero__when { text-align: right; flex: none !important; }
  .dk-hero__when strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-hero__when span { font-size: 13px; font-weight: 600; opacity: 0.7; }
  .dk-hero--stat b#admin-hero-titre { font-size: 36px; }
  .dk-split--admin .tabs { background: var(--color-surface); padding: 5px; border-radius: 999px; width: fit-content; margin: 0; }
  .dk-split--admin .tabs button { min-height: 38px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 600; }
  .dk-split--admin .tabs button.active { background: var(--color-ink); color: var(--color-ink-contrast); font-weight: 700; box-shadow: none; }
  .dk-split--admin .page__subtitle { display: none; }
  .dk-split--admin .demarche-list { display: flex; flex-direction: column; gap: 10px; }
  .dk-split--admin .demarche-item { border-radius: 24px; background: var(--color-surface); }
  .dk-split--admin .demarche-item.is-selected { box-shadow: inset 0 0 0 3px var(--color-ink); }
  .dk-split--admin .demarche-item__detail-wrap, .dk-split--admin .demarche-item__chevron { display: none !important; }
  .dk-desc { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--color-text-muted); }
  .dk-mois-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
  .dk-mois { height: 34px; border-radius: 12px; background: var(--color-bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--color-text-muted); }
  .dk-mois.is-fait { background: var(--pastel-lime); color: var(--txt-encre); --txt-encre: #1B1A17; }
  .dk-mois.is-afaire { background: var(--pastel-orange-clair); color: var(--txt-encre); --txt-encre: #1B1A17; }
}

/* ---------- DK-7 Projets ---------- */
@media (min-width: 721px) {
  .dk-split--projets { --dk-cols: minmax(0, 1fr) minmax(0, 1.15fr); }
  .dk-split--projets .renouv-widget { max-height: 190px; overflow: hidden; }
  .dk-split--projets .page__subtitle { display: none; }
  .dk-split--projets .cards { display: flex; flex-direction: column; gap: 12px; }
  .dk-split--projets .tile { border-radius: 28px; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }
  .dk-split--projets .tile:nth-child(4n + 1) { background: var(--pastel-lilas); --txt-encre: #1B1A17; }
  .dk-split--projets .tile:nth-child(4n + 3) { background: var(--pastel-menthe); --txt-encre: #1B1A17; }
  .dk-split--projets .tile.is-selected { box-shadow: inset 0 0 0 3px var(--color-ink); }
  .dk-split--projets .tile__title { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-split--projets .tile__stats { display: none; }
  .dk-split--projets .tile__footer { margin: 0; }
  .dk-hero--col { flex-direction: column; align-items: stretch; gap: 16px; }
  .dk-hero--col h2 { margin: 6px 0 0; font-size: 40px; }
  .dk-hero__row { display: flex; align-items: center; justify-content: space-between; }
  .dk-hero__row a { text-decoration: none; font-size: 13px; padding: 9px 16px; }
  .dk-stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .dk-stage i { display: block; height: 8px; border-radius: 99px; background: rgba(27, 26, 23, 0.2); }
  .dk-stage.is-done i { background: #1B1A17; }
  .dk-stage span { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: #3F3770; }
  .dk-stage.is-now span { font-weight: 800; color: var(--txt-encre); }
  .dk-pill--soft { background: var(--color-bg); }
  .dk-tk { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--color-bg); font-size: 14px; font-weight: 600; }
  .dk-tk:first-of-type { border-top: 0; }
  .dk-tk span { flex: 1; }
  .dk-tk em { font-style: normal; font-size: 12px; background: var(--pastel-orange-clair); border-radius: 999px; padding: 6px 12px; font-weight: 700; --txt-encre: #1B1A17; }
  .dk-tk.is-done span { color: var(--color-text-muted); text-decoration: line-through; }
  .dk-cb { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--color-ink); background: none; padding: 0; cursor: pointer; flex: none; }
  .dk-tk.is-done .dk-cb { background: var(--pastel-lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B1A17' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--pastel-lime); --txt-encre: #1B1A17; }
  .dk-card--orange small, .dk-card--menthe small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; opacity: 0.75; }
  .dk-mini { display: block; font-size: 13px; font-weight: 700; }
  .dk-mini-val { display: block; margin-top: 6px; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
}

/* ---------- DK-10 Communication : à venir à gauche, calendrier à droite ---------- */
@media (min-width: 721px) {
  .dk-com .dk-col > h2.u-mt-4 { margin-top: 6px; }
  .dk-com #com-prochains-list { display: flex; flex-direction: column; gap: 10px; }
  .dk-com #com-prochains-list .list-row { background: var(--color-surface); border-radius: 24px; padding: 14px 20px; border: 0; }
  .dk-card--cal { background: var(--color-surface); border-radius: 28px; padding: 22px; margin-top: 62px; }
  .dk-card--cal .cal-controls { justify-content: space-between; }
  .dk-card--cal .cal-controls .btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
  .dk-hero__lbl { font-size: 13px; font-weight: 700; }
}
@media (min-width: 721px) {
  .dk-card--cal .cal-month__grid { grid-auto-rows: 74px; }
}

/* ---------- DK-11 Messagerie : liste à gauche, lecture à droite ---------- */
@media (min-width: 721px) {
  .page--mail { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 14px 20px; align-items: start; }
  .page--mail > .page__header { grid-column: 1; margin: 0; padding: 6px 4px 0; }
  .page--mail > .tabs { grid-column: 1; background: var(--color-surface); padding: 5px; border-radius: 999px; width: fit-content; margin: 0; }
  .page--mail > .tabs button { min-height: 38px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 600; }
  .page--mail > .tabs button.active { background: var(--color-ink); color: var(--color-ink-contrast); font-weight: 700; box-shadow: none; }
  .page--mail > #section-boite, .page--mail > #section-contacts { grid-column: 1 / -1; }
  .page--mail .mail-layout { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); grid-template-rows: auto minmax(0, 1fr); gap: 14px 20px; }
  .page--mail .mail-sidebar { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .page--mail .mail-folders { flex-direction: row; }
  .page--mail .mail-compose-btn { order: 2; border-radius: 999px; height: 46px; padding: 0 22px; background: var(--color-accent); }
  .page--mail .mail-list-pane { grid-column: 1; grid-row: 2; height: calc(100vh - 330px); background: none; border: 0; padding: 0; }
  .page--mail .mail-list-pane__head { display: none; }
  .page--mail .mail-list { display: flex; flex-direction: column; gap: 10px; }
  .page--mail .mail-reading-pane { grid-column: 2; grid-row: 1 / span 2; background: var(--color-surface); border: 0; border-radius: 28px; padding: 28px; height: calc(100vh - 240px); }
  .page--mail .mail-folder.is-active { background: var(--color-ink); color: var(--color-ink-contrast); }
  .page--mail .mail-folder { border-radius: 999px; }
}
@media (min-width: 721px) {
  .page--mail .mail-row { background: var(--color-surface); border: 0; border-radius: 24px; padding: 14px 18px; }
  .page--mail .mail-row.is-non-lue { box-shadow: inset 0 0 0 2px var(--color-ink); }
}

/* ---------- DK-13 Transferts ---------- */
@media (min-width: 721px) {
  .dk-split--colis { --dk-cols: minmax(0, 1fr) minmax(0, 1fr); }
  .dk-split--colis .page__subtitle { display: none; }
  .dk-split--colis #btn-new-colis { display: none; }
  .dk-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px; border: 2px dashed var(--color-ink); border-radius: 32px; background: var(--pastel-lilas-clair); color: var(--color-text); font-family: inherit; cursor: pointer; --txt-encre: #1B1A17; }
  .dk-drop__ic { width: 60px; height: 60px; border-radius: 20px; background: var(--color-ink); color: var(--pastel-lime); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
  .dk-drop b { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-drop small { font-size: 13px; color: var(--color-text-muted); margin-bottom: 10px; }
  .dk-h2-recents { margin: 6px 4px 0; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .dk-split--colis .colis-list { display: flex; flex-direction: column; gap: 10px; }
  .dk-split--colis .colis-item { border-radius: 24px; background: var(--color-surface); }
  .dk-split--colis .colis-item.is-selected { box-shadow: inset 0 0 0 3px var(--color-ink); }
  .dk-split--colis .colis-list .colis-item__detail-wrap, .dk-split--colis .colis-list .colis-item__chevron { display: none !important; }
  .dk-colis { display: flex; flex-direction: column; gap: 14px; }
}

#devis-hero { display: none; }
@media (min-width: 721px) {
  #devis-hero { display: flex; }
}

/* Surface « encre » : reste sombre en thème sombre (les jetons --color-ink s'inversent). */
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --dk-ink-surface: #2A2927; } }
:root[data-theme='dark'] { --dk-ink-surface: #2A2927; }
@media (min-width: 721px) {
  .dk-hero h2 { color: inherit; }
  .dk-hero--lime, .dk-hero--lilas, .dk-hero--menthe, .dk-hero--orange, .dk-identity, .dk-card--lilas, .dk-card--orange, .dk-card--lime, .dk-card--menthe, .dk-ev__c { color: var(--txt-encre); }
  .dk-identity b, .dk-card--lilas b, .dk-card--orange b, .dk-card--menthe b, .dk-card--lime b { color: var(--txt-encre); }
  .dk-hero--stat b { color: inherit; }
}

/* ---------- Comptabilité : suivi des dépenses et charges ---------- */
.charges-actions { display: flex; gap: 8px; }
.charges-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.charges-kpi { border-radius: 24px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--txt-encre); min-width: 0; }
.charges-kpi span { font-size: 12px; font-weight: 700; }
.charges-kpi strong { font-size: 26px; line-height: 1.05; font-weight: 800; letter-spacing: -0.04em; }
.charges-kpi small { font-size: 11px; font-weight: 600; opacity: 0.7; }
.charges-kpi--ink { background: var(--dk-ink-surface, #1B1A17); color: #fff; }
.charges-kpi--lilas { background: var(--pastel-lilas); --txt-encre: #1B1A17; }
.charges-kpi--orange { background: var(--pastel-orange); --txt-encre: #1B1A17; }
.charges-kpi--lime { background: var(--pastel-lime); --txt-encre: #1B1A17; }
.charges-viz { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; border-radius: 28px; }
.charges-viz h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.charges-mois { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 96px; align-items: end; }
.charges-mois__col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: 11px; font-weight: 700; color: var(--color-text-muted); }
.charges-mois__col i { display: block; width: 100%; border-radius: 6px; background: var(--pastel-lilas); --txt-encre: #1B1A17; }
.charges-mois__col.is-now i { background: var(--pastel-lime); --txt-encre: #1B1A17; }
.charges-cats { display: flex; flex-direction: column; gap: 6px; }
.charges-cat { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 14px; background: none; font: 600 13px var(--font-sans); color: var(--color-text); text-align: left; cursor: pointer; }
.charges-cat:hover, .charges-cat.is-active { background: var(--color-bg); }
.charges-cat > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charges-cat__bar { height: 8px; border-radius: 99px; background: var(--color-bg); overflow: hidden; }
.charges-cat__bar i { display: block; height: 100%; border-radius: 99px; background: var(--color-ink); }
.charges-chip { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--color-ink); color: var(--color-ink-contrast); font: 700 12px var(--font-sans); cursor: pointer; margin-bottom: 10px; }
.charge-row { cursor: pointer; }
#charges-tbody td:nth-child(3), #charges-tbody td:nth-child(4), #charges-tbody td:nth-child(5) { white-space: nowrap; }
.charges-kpi strong { font-size: 24px; }
