/* ==========================================================================
   COMPOSANTS — boutons, badges, cartes, KPI, tableaux, formulaires,
   modales, toasts, progression, stepper, timeline, GED, kanban, gantt…
   ========================================================================== */

/* ---------------- Boutons ---------------- */
.btn {
  --btn-bg: var(--surface-solid);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600; font-size: 0.85rem;
  white-space: nowrap;
  text-decoration: none !important;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
  user-select: none;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--btn-bd) 60%, var(--text)); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn--primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn--primary:hover { --btn-bg: color-mix(in srgb, var(--primary) 88%, black); box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--primary) 90%, transparent); }
.btn--secondary { --btn-bg: var(--secondary); --btn-fg: #fff; --btn-bd: transparent; }
.btn--secondary:hover { --btn-bg: color-mix(in srgb, var(--secondary) 88%, black); }
.btn--soft { --btn-bg: var(--primary-soft); --btn-fg: var(--primary-text); --btn-bd: transparent; }
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); }
.btn--ghost:hover { background: var(--surface-hover); box-shadow: none; }
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: transparent; }
.btn--success { --btn-bg: var(--success); --btn-fg: #fff; --btn-bd: transparent; }
.btn--sm { height: 31px; padding: 0 11px; font-size: 0.78rem; border-radius: 8px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 0.95rem; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--icon { width: 38px; padding: 0; }
.btn--icon.btn--sm { width: 31px; }
.btn.is-loading { pointer-events: none; opacity: 0.8; }
.btn.is-loading svg { animation: spin 0.9s linear infinite; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  display: grid; place-items: center;
  color: var(--text-2);
  position: relative;
  transition: background var(--t-fast);
}
.icon-btn:hover { background: var(--surface-hover); border-color: var(--border); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot-count {
  position: absolute; top: 4px; right: 4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 0.64rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--bg);
}

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 600;
  white-space: nowrap;
  background: var(--neutral-soft); color: var(--muted);
  line-height: 1;
}
.badge svg { width: 13px; height: 13px; }
.badge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--success-soft); color: var(--success-text); }
.badge--warning { background: var(--warning-soft); color: var(--warning-text); }
.badge--danger { background: var(--danger-soft); color: var(--danger-text); }
.badge--info { background: var(--info-soft); color: var(--info-text); }
.badge--primary { background: var(--primary-soft); color: var(--primary-text); }
.badge--secondary { background: var(--secondary-soft); color: var(--secondary-text); }
.badge--outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.badge--new {
  background: linear-gradient(135deg, #f43f5e, #f97316); color: #fff;
  height: 19px; padding: 0 7px; font-size: 0.64rem; letter-spacing: 0.02em; text-transform: uppercase;
  box-shadow: 0 4px 10px -4px rgba(244, 63, 94, 0.6);
}
.badge--lg { height: 28px; padding: 0 12px; font-size: 0.8rem; }

/* ---------------- Cartes ---------------- */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--hover { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); }
.card--hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card--brand {
  background: var(--gradient-brand);
  color: #fff; border-color: transparent;
  box-shadow: 0 18px 40px -20px color-mix(in srgb, var(--primary) 85%, transparent);
}
.card--brand h2, .card--brand h3, .card--brand h4 { color: #fff; }
.card--brand .muted { color: rgba(255,255,255,0.78); }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.card--flush .card__head { padding: var(--sp-5) var(--sp-5) 0; }
.card__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card__title h3 { font-size: 1rem; }
.card__icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
}
.card__icon svg { width: 18px; height: 18px; }
.card__icon--teal { background: var(--secondary-soft); color: var(--secondary-text); }
.card__icon--warning { background: var(--warning-soft); color: var(--warning-text); }
.card__icon--danger { background: var(--danger-soft); color: var(--danger-text); }
.card__icon--success { background: var(--success-soft); color: var(--success-text); }
.card__sub { font-size: var(--fs-xs); color: var(--muted); }
.card__foot { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px dashed var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- KPI ---------------- */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpi__value { font-family: var(--font-title); font-size: 2rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 0.95rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi__trend { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 600; }
.kpi__trend svg { width: 14px; height: 14px; }
.kpi__trend.up { color: var(--success-text); }
.kpi__trend.down { color: var(--danger-text); }
.kpi__list { display: grid; gap: 5px; margin-top: 2px; }
.kpi__list li { list-style: none; font-size: 0.76rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi__list li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--secondary); flex: none; }
.kpi__list { padding: 0; margin: 0; }

.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.kpi-mini {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; min-width: 0;
  backdrop-filter: var(--glass-blur);
}
.kpi-mini__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; font-size: 1.15rem; background: var(--primary-soft); }
.kpi-mini__value { font-family: var(--font-title); font-weight: 600; font-size: 1.15rem; line-height: 1.1; }
.kpi-mini__label { font-size: 0.72rem; color: var(--muted); }

/* ---------------- Tableaux ---------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; }
.table th {
  text-align: left; font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .sort-ind { opacity: 0.4; margin-left: 4px; font-size: 0.7rem; }
.table th.is-sorted .sort-ind { opacity: 1; color: var(--primary-text); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover td { background: var(--primary-softer); }
.table tbody tr.is-clickable { cursor: pointer; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-tools { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: var(--fs-sm); color: var(--muted); }
.pagination .btns { display: flex; gap: 6px; }

/* ---------------- Formulaires (labels flottants) ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.form-grid .full { grid-column: 1 / -1; }
.form-section-title {
  grid-column: 1 / -1;
  font-family: var(--font-title); font-weight: 600; font-size: 0.95rem;
  display: flex; align-items: center; gap: 8px;
  padding-top: var(--sp-2);
  color: var(--text);
}
.form-section-title svg { width: 17px; height: 17px; color: var(--primary-text); }
.field { position: relative; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 50px;
  padding: 20px 14px 6px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-size: 0.9rem;
  appearance: none;
}
.field textarea { height: auto; min-height: 96px; padding-top: 24px; resize: vertical; }
.field select { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field label {
  position: absolute; left: 15px; top: 15px;
  font-size: 0.88rem; color: var(--muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform var(--t-fast) var(--ease), color var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field select + label, .field.is-static label {
  transform: translateY(-9px) scale(0.76);
  color: var(--primary-text);
  font-weight: 600;
}
.field input:not(:focus):not(:placeholder-shown) + label,
.field textarea:not(:focus):not(:placeholder-shown) + label,
.field select:not(:focus) + label { color: var(--muted); }
.field.is-valid input { border-color: color-mix(in srgb, var(--success) 60%, var(--border-strong)); }
.field.is-invalid input, .field.is-invalid select { border-color: var(--danger); }
.field.is-invalid input:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.field__hint { font-size: 0.72rem; color: var(--muted); margin-top: 5px; padding-left: 2px; }
.field.is-invalid .field__hint { color: var(--danger-text); }
.field__suffix { position: absolute; right: 14px; top: 17px; font-size: 0.85rem; color: var(--muted); pointer-events: none; }
.field input[type="color"] { padding: 22px 10px 6px; cursor: pointer; }
.field input[type="date"] { padding-right: 10px; }

.input {
  height: 36px; padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  outline: none; font-size: 0.85rem;
  min-width: 0;
}
.input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-input .input { padding-left: 34px; width: 240px; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.88rem; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: none; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choice {
  position: relative;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex; gap: 10px; align-items: flex-start;
  transition: border-color var(--t-fast), background var(--t-fast);
  background: var(--surface-solid);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__icon { font-size: 1.2rem; line-height: 1; }
.choice__label { font-weight: 600; font-size: 0.84rem; line-height: 1.25; }
.choice__desc { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.choice:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border-strong)); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-softer); box-shadow: var(--ring); }

.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--border-strong); transition: background var(--t-fast); cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t) var(--ease); }
.switch input:checked + span { background: var(--secondary); }
.switch input:checked + span::after { transform: translateX(17px); }

/* ---------------- Filtres / pills / onglets ---------------- */
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  height: 33px; padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  font-size: 0.8rem; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--t-fast);
}
.pill:hover { border-color: var(--primary); }
.pill.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill .pill-count { font-size: 0.7rem; opacity: 0.7; }

.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent;
  padding: 11px 14px;
  font-weight: 600; font-size: 0.85rem; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary-text); border-bottom-color: var(--primary); }
.tab .badge { height: 19px; padding: 0 7px; }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 10px; border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.segmented button.is-active { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-xs); }

/* ---------------- Avatars ---------------- */
.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  background: var(--av, var(--primary));
  letter-spacing: 0.02em;
}
.avatar--sm { width: 26px; height: 26px; font-size: 0.62rem; }
.avatar--lg { width: 52px; height: 52px; font-size: 1rem; border-radius: 15px; }
.avatar--sq { border-radius: 10px; }

/* ---------------- Progression ---------------- */
.progress { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress__bar {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 900ms var(--ease);
}
.progress--sm { height: 5px; }
.progress--lg { height: 12px; }
.progress--success .progress__bar { background: var(--success); }
.progress--warning .progress__bar { background: var(--warning); }
.progress--danger .progress__bar { background: var(--danger); }
.progress-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-bottom: 5px; gap: 8px; }
.progress-label strong { color: var(--text); font-weight: 600; }

.gauge { position: relative; width: 120px; height: 120px; flex: none; }
.gauge svg { transform: rotate(-90deg); }
.gauge__track { stroke: var(--surface-3); }
.gauge__val { stroke: url(#gaugeGrad); transition: stroke-dashoffset 1s var(--ease); stroke-linecap: round; }
.gauge__label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge__label strong { font-family: var(--font-title); font-size: 1.55rem; display: block; line-height: 1; }
.gauge__label span { font-size: 0.68rem; color: var(--muted); }

/* ---------------- Stepper (workflow 9 phases) ---------------- */
.stepper { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; position: relative; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 2px; }
.step::before {
  content: ''; position: absolute; top: 17px; left: calc(-50% + 18px); right: calc(50% + 18px);
  height: 3px; border-radius: 3px; background: var(--surface-3);
}
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-current::before { background: linear-gradient(90deg, var(--secondary), var(--secondary)); }
.step__dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted);
  font-weight: 700; font-size: 0.8rem;
  border: 2px solid transparent;
  position: relative; z-index: 1;
  transition: all var(--t) var(--ease);
}
.step__dot svg { width: 17px; height: 17px; }
.step.is-done .step__dot { background: var(--secondary); color: #fff; }
.step.is-current .step__dot {
  background: var(--surface-solid); color: var(--primary-text);
  border-color: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft);
}
.step__label { font-size: 0.72rem; font-weight: 600; color: var(--muted); line-height: 1.25; }
.step.is-done .step__label { color: var(--text-2); }
.step.is-current .step__label { color: var(--primary-text); }
.step__here {
  font-size: 0.62rem; font-weight: 700; color: #fff; background: var(--primary);
  padding: 2px 7px; border-radius: 10px; white-space: nowrap;
  animation: fadeUp 500ms var(--ease) both;
}
.stepper.is-clickable .step__dot { cursor: pointer; }
.stepper.is-clickable .step__dot:hover { transform: scale(1.08); }

/* Version verticale (mobile client) */
.vsteps { display: grid; gap: 0; }
.vstep { display: grid; grid-template-columns: 30px 1fr; gap: 12px; position: relative; padding-bottom: 14px; }
.vstep::before { content: ''; position: absolute; left: 14px; top: 28px; bottom: 0; width: 2px; background: var(--surface-3); }
.vstep:last-child::before { display: none; }
.vstep.is-done::before { background: var(--secondary); }
.vstep__dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.vstep__dot svg { width: 15px; height: 15px; }
.vstep.is-done .vstep__dot { background: var(--secondary); color: #fff; }
.vstep.is-current .vstep__dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 5px var(--primary-soft); }
.vstep__label { font-weight: 600; font-size: 0.88rem; padding-top: 4px; }
.vstep.is-todo .vstep__label { color: var(--muted); font-weight: 500; }

/* ---------------- Timeline / journal ---------------- */
.timeline { display: grid; gap: 0; position: relative; }
.tl-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 16px; top: 34px; bottom: 2px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.tl-icon svg { width: 16px; height: 16px; }
.tl-icon--success { background: var(--success-soft); color: var(--success-text); }
.tl-icon--warning { background: var(--warning-soft); color: var(--warning-text); }
.tl-icon--danger { background: var(--danger-soft); color: var(--danger-text); }
.tl-icon--teal { background: var(--secondary-soft); color: var(--secondary-text); }
.tl-title { font-weight: 600; font-size: 0.86rem; line-height: 1.35; }
.tl-meta { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

/* Frise horizontale (planning simplifié client) */
.frise { display: grid; gap: 0; }
.frise-item { display: grid; grid-template-columns: 82px 18px 1fr; gap: 12px; align-items: start; padding: 0 0 18px; position: relative; }
.frise-item::before { content: ''; position: absolute; left: 90px; top: 16px; bottom: -2px; width: 2px; background: var(--surface-3); }
.frise-item:last-child::before { display: none; }
.frise-date { font-size: 0.74rem; color: var(--muted); text-align: right; font-weight: 600; padding-top: 1px; line-height: 1.25; }
.frise-dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--surface-3); background: var(--surface-solid); position: relative; z-index: 1; margin-top: 1px; }
.frise-item.is-done .frise-dot { border-color: var(--secondary); background: var(--secondary); }
.frise-item.is-next .frise-dot { border-color: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.frise-item.is-next .frise-body { background: var(--primary-softer); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); border-radius: 12px; padding: 10px 12px; margin-top: -8px; }
.frise-title { font-weight: 600; font-size: 0.87rem; }
.frise-sub { font-size: 0.75rem; color: var(--muted); }

/* ---------------- Listes ---------------- */
.list { display: grid; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.list-item:last-child { border-bottom: 0; }
.list-item__main { flex: 1; min-width: 0; }
.list-item__title { font-weight: 600; font-size: 0.87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__sub { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item.is-clickable { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.list-item.is-clickable:hover { background: var(--surface-hover); }

/* Alertes priorisées */
.alert-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  border-left: 4px solid var(--a-color, var(--info));
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.alert-row:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.alert-row + .alert-row { margin-top: 8px; }
.alert-row__emoji { font-size: 1.05rem; flex: none; }
.alert-row__main { flex: 1; min-width: 0; }
.alert-row__title { font-weight: 600; font-size: 0.85rem; }
.alert-row__sub { font-size: 0.74rem; color: var(--muted); }
.alert-row--critical { --a-color: var(--danger); }
.alert-row--high { --a-color: #ea580c; }
.alert-row--medium { --a-color: #eab308; }
.alert-row--info { --a-color: var(--info); }

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 15px; border-radius: 12px;
  background: var(--info-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
  font-size: 0.85rem;
}
.callout svg { width: 18px; height: 18px; flex: none; color: var(--info-text); margin-top: 1px; }
.callout--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.callout--warning svg { color: var(--warning-text); }
.callout--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.callout--danger svg { color: var(--danger-text); }
.callout--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.callout--success svg { color: var(--success-text); }

/* ---------------- Étoiles ---------------- */
.stars { display: inline-flex; gap: 1px; color: #f59e0b; font-size: 0.85rem; letter-spacing: -1px; line-height: 1; }
.stars .off { color: var(--border-strong); }

/* ---------------- Modales ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 24px;
  pointer-events: auto;
  animation: fadeIn 200ms both;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: scaleIn 280ms var(--ease) both;
  overflow: hidden;
}
.modal--sm { max-width: 420px; }
.modal--lg { max-width: 860px; }
.modal--xl { max-width: 1120px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 1.12rem; }
.modal__head p { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.modal__body { padding: 20px 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.modal.is-leaving { animation: fadeIn 150ms reverse both; }

/* ---------------- Dropdown ---------------- */
.dropdown {
  position: fixed; z-index: 90;
  min-width: 260px; max-width: 380px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: scaleIn 180ms var(--ease) both;
  max-height: 72vh; overflow-y: auto;
}
.dropdown__title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--subtle); padding: 8px 10px 4px; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: transparent; text-align: left;
  padding: 8px 10px; border-radius: 9px; font-size: 0.85rem;
}
.dropdown__item:hover { background: var(--surface-hover); }
.dropdown__item.is-active { background: var(--primary-soft); }
.dropdown__sep { height: 1px; background: var(--border); margin: 5px 4px; }

.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; position: relative; }
.notif-item:hover { background: var(--surface-hover); }
.notif-item.is-unread { background: var(--primary-softer); }
.notif-item.is-unread::after { content: ''; position: absolute; right: 10px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.notif-item__title { font-size: 0.82rem; font-weight: 600; padding-right: 14px; }
.notif-item__msg { font-size: 0.76rem; color: var(--muted); line-height: 1.4; }
.notif-item__time { font-size: 0.68rem; color: var(--subtle); margin-top: 3px; }

/* ---------------- Toasts ---------------- */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 13px 14px;
  animation: slideInRight 320ms var(--ease) both;
  border-left: 4px solid var(--t-color, var(--info));
}
.toast.is-leaving { animation: slideInRight 220ms var(--ease) reverse both; }
.toast__icon { width: 20px; height: 20px; color: var(--t-color, var(--info)); flex: none; margin-top: 1px; }
.toast__title { font-weight: 600; font-size: 0.86rem; }
.toast__msg { font-size: 0.78rem; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.toast--success { --t-color: var(--success); }
.toast--warning { --t-color: var(--warning); }
.toast--danger { --t-color: var(--danger); }
.toast--info { --t-color: var(--info); }

/* ---------------- Empty state ---------------- */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); font-size: 1.5rem; }
.empty__icon svg { width: 24px; height: 24px; }
.empty h4 { color: var(--text); margin-bottom: 4px; }

/* ---------------- GED : dossiers / fichiers ---------------- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); }
.folder-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t);
  backdrop-filter: var(--glass-blur);
  text-align: left;
}
.folder-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.folder-card__emoji { font-size: 1.9rem; line-height: 1; }
.folder-card__name { font-weight: 600; font-size: 0.92rem; }
.folder-card__desc { font-size: 0.74rem; color: var(--muted); line-height: 1.35; }
.folder-card__meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.74rem; color: var(--muted); margin-top: auto; }
.folder-card .badge--new { position: absolute; top: 14px; right: 14px; }

.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  min-width: 0;
}
.file-row + .file-row { margin-top: 8px; }
.file-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.file-icon {
  width: 38px; height: 44px; flex: none;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.03em;
  color: #fff;
  background: var(--fi, #64748b);
  position: relative;
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.file-icon--pdf { --fi: #e11d48; }
.file-icon--img { --fi: #7c3aed; }
.file-icon--dwg { --fi: #0891b2; }
.file-icon--xls { --fi: #16a34a; }
.file-icon--doc { --fi: #2563eb; }
.file-thumb { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; flex: none; background: var(--surface-3); }
.file-thumb img, .file-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.file-row__main { flex: 1; min-width: 0; }
.file-row__name { font-weight: 600; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row__meta { font-size: 0.72rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.file-row__actions { display: flex; gap: 4px; flex: none; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo {
  position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border);
}
.photo img, .photo svg { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t) var(--ease); }
.photo:hover img, .photo:hover svg { transform: scale(1.04); }
.photo__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 9px 7px; font-size: 0.68rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.65)); }
.photo .badge--new { position: absolute; top: 7px; right: 7px; }

/* Arborescence GED */
.tree { font-size: 0.84rem; user-select: none; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 16px; }
.tree > ul { padding-left: 0; }
.tree-node {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-2);
}
.tree-node:hover { background: var(--surface-hover); }
.tree-node.is-active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.tree-node.is-drop { background: var(--secondary-soft); outline: 2px dashed var(--secondary); }
.tree-node svg { width: 15px; height: 15px; flex: none; }
.tree-node .caret { transition: transform var(--t-fast); opacity: 0.6; }
.tree-node.is-open > .caret { transform: rotate(90deg); }
.tree-node .count { margin-left: auto; font-size: 0.68rem; color: var(--subtle); padding-left: 8px; }
.tree-node .folder-ic { color: #eab308; }
.tree-children { display: none; }
.tree-children.is-open { display: block; }

.ged-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.ged-pane { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow: auto; }
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.breadcrumb span.sep { opacity: 0.5; }
.breadcrumb b { color: var(--text); font-weight: 600; }

.drive-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px; border-radius: 20px;
  background: var(--surface-solid); border: 1px solid var(--border);
  font-size: 0.74rem; font-weight: 600;
}
.drive-logo { width: 16px; height: 16px; }

/* Zone d'upload */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 18px;
  text-align: center;
  background: var(--primary-softer);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.is-over { transform: scale(1.01); }
.dropzone__icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-solid); color: var(--primary-text); box-shadow: var(--shadow-sm); }
.dropzone__icon svg { width: 22px; height: 22px; }
.dropzone__title { font-weight: 600; font-size: 0.9rem; }
.dropzone__sub { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }
.dropzone input[type=file] { display: none; }

.upload-progress { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; padding: 8px 0; }
.upload-progress .progress { flex: 1; }

/* Bouton flottant (FAB) */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  height: 54px; padding: 0 22px 0 18px;
  border-radius: 27px; border: 0;
  background: var(--gradient-brand); color: #fff;
  font-weight: 700; font-size: 0.9rem;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--primary) 85%, transparent);
  transition: transform var(--t) var(--ease), box-shadow var(--t);
  animation: scaleIn 400ms var(--ease) both;
}
.fab:hover { transform: translateY(-2px) scale(1.02); }
.fab svg { width: 20px; height: 20px; }

/* Prévisualisation document */
.preview-frame { width: 100%; height: 66vh; border: 0; border-radius: 12px; background: var(--surface-3); }
.doc-mock {
  width: 100%; max-width: 600px; margin: 0 auto;
  aspect-ratio: 1 / 1.414;
  background: #fff; color: #1f2937;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  padding: 7% 8%;
  font-size: 0.72rem;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.doc-mock__head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--primary); padding-bottom: 10px; }
.doc-mock__title { font-family: var(--font-title); font-size: 1.1rem; font-weight: 700; color: #0f172a; }
.doc-mock__line { height: 7px; border-radius: 4px; background: #e5e7eb; }
.doc-mock__table { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.doc-mock__table div { height: 16px; border-radius: 3px; background: #f1f5f9; }
.doc-mock__table div:nth-child(-n+3) { background: #e2e8f0; }
.doc-mock__stamp { margin-top: auto; align-self: flex-end; border: 2px solid #0d9488; color: #0d9488; padding: 6px 12px; border-radius: 8px; transform: rotate(-6deg); font-weight: 800; letter-spacing: 0.05em; }

/* ---------------- Kanban ---------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  min-height: 240px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.kanban-col.is-over { background: var(--primary-softer); border-color: var(--primary); border-style: dashed; }
.kanban-col__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.kanban-col__title { font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.kanban-col__title::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--col, var(--primary)); }
.kanban-col__count { font-size: 0.7rem; color: var(--muted); background: var(--surface-solid); border: 1px solid var(--border); padding: 1px 7px; border-radius: 10px; }
.kanban-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: grab;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  border-top: 3px solid var(--col, var(--primary));
}
.kanban-card { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.is-dragging { opacity: 0.45; transform: rotate(2deg); }
.kanban-card__title { font-weight: 600; font-size: 0.83rem; line-height: 1.3; }
.kanban-card__meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; color: var(--muted); margin: 7px 0 8px; gap: 6px; }
.kanban-empty { font-size: 0.74rem; color: var(--subtle); text-align: center; padding: 18px 6px; border: 1px dashed var(--border-strong); border-radius: 10px; }

/* ---------------- Gantt ---------------- */
.gantt-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.gantt {
  --day-w: 26px;
  --row-h: 42px;
  --label-w: 250px;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-solid);
  overflow: hidden;
}
.gantt__scroll { overflow: auto; max-height: 70vh; position: relative; }
.gantt__grid { display: grid; grid-template-columns: var(--label-w) max-content; min-width: max-content; position: relative; }
.gantt__corner, .gantt__labels-head {
  position: sticky; left: 0; top: 0; z-index: 6;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  display: flex; align-items: flex-end; padding: 8px 12px;
}
.gantt__header { position: sticky; top: 0; z-index: 5; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.gantt__months { display: flex; height: 24px; border-bottom: 1px solid var(--border); }
.gantt__month { font-size: 0.7rem; font-weight: 700; color: var(--text-2); padding: 4px 8px; border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-transform: capitalize; }
.gantt__days { display: flex; height: 26px; }
.gantt__day { width: var(--day-w); flex: none; font-size: 0.62rem; color: var(--muted); display: grid; place-items: center; border-right: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.gantt__day.is-weekend { background: color-mix(in srgb, var(--surface-3) 70%, transparent); }
.gantt__day.is-today { color: #fff; background: var(--danger); font-weight: 700; }
.gantt__label {
  position: sticky; left: 0; z-index: 4;
  height: var(--row-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--surface-solid);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem; min-width: 0;
}
.gantt__label.is-sub { padding-left: 30px; color: var(--text-2); font-size: 0.76rem; }
.gantt__label.is-group { background: var(--surface-2); font-weight: 700; font-family: var(--font-title); font-size: 0.84rem; }
.gantt__label .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.gantt__label .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.gantt__row { position: relative; height: var(--row-h); border-bottom: 1px solid var(--border); }
.gantt__row.is-group { background: var(--surface-2); }
.gantt__bg { position: absolute; inset: 0; display: flex; pointer-events: none; }
.gantt__bg span { width: var(--day-w); flex: none; border-right: 1px solid color-mix(in srgb, var(--border) 45%, transparent); }
.gantt__bg span.is-weekend { background: color-mix(in srgb, var(--surface-3) 50%, transparent); }
.gantt__today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 3; pointer-events: none; opacity: 0.85; }
.gantt__today::before { content: "Aujourd'hui"; position: absolute; top: 4px; left: 4px; font-size: 0.6rem; font-weight: 700; color: var(--danger); white-space: nowrap; }
.gantt__bar {
  position: absolute; top: 8px; height: calc(var(--row-h) - 16px);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bar) 22%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--bar) 55%, transparent);
  overflow: hidden;
  cursor: grab;
  z-index: 1;
  display: flex; align-items: center;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-fast);
  touch-action: none;
}
.gantt__bar:hover { box-shadow: var(--shadow-md); }
.gantt__bar.is-dragging { cursor: grabbing; box-shadow: var(--shadow-lg); z-index: 3; }
.gantt__bar.is-readonly { cursor: default; }
.gantt__bar.is-sub { top: 12px; height: calc(var(--row-h) - 24px); border-radius: 6px; }
.gantt__bar.is-late { outline: 2px solid var(--danger); outline-offset: 1px; }
.gantt__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); opacity: 0.9; }
.gantt__txt { position: relative; z-index: 1; font-size: 0.7rem; font-weight: 700; color: var(--text); padding: 0 8px; white-space: nowrap; text-shadow: 0 0 3px var(--surface-solid), 0 0 2px var(--surface-solid); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gantt__handle { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 2; }
.gantt__handle::after { content: ''; position: absolute; right: 3px; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: rgba(255,255,255,0.8); }
.gantt__milestone { position: absolute; top: 50%; width: 16px; height: 16px; transform: translate(-50%, -50%) rotate(45deg); background: var(--primary); border-radius: 3px; z-index: 1; box-shadow: var(--shadow-sm); }
.gantt__deps { position: absolute; left: var(--label-w); top: 0; pointer-events: none; z-index: 1; overflow: visible; }
.gantt__deps path { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: 0.7; }
.gantt-tooltip { position: fixed; z-index: 150; pointer-events: none; background: var(--text); color: var(--bg); font-size: 0.74rem; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-md); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.74rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------------- Relevé financier (client) ---------------- */
.statement {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 720px;
}
.statement__head { background: var(--gradient-brand); color: #fff; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.statement__head h3 { color: #fff; font-size: 1.05rem; letter-spacing: 0.02em; }
.statement__body { padding: 8px 24px 20px; }
.stmt-line { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; font-size: 0.92rem; }
.stmt-line__label { white-space: nowrap; color: var(--text-2); }
.stmt-line__dots { flex: 1; border-bottom: 2px dotted var(--border-strong); transform: translateY(-4px); min-width: 20px; }
.stmt-line__val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.stmt-line--minus .stmt-line__val { color: var(--success-text); }
.stmt-sep { border-top: 1px solid var(--border); margin: 6px 0; }
.stmt-total {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 10px -8px; padding: 16px 18px;
  background: var(--primary-softer);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 14px;
}
.stmt-total__label { font-family: var(--font-title); font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.stmt-total__val { font-family: var(--font-title); font-weight: 700; font-size: 1.9rem; color: var(--primary-text); font-variant-numeric: tabular-nums; }

.big-number { font-family: var(--font-title); font-weight: 700; font-size: 2.4rem; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------------- Chantier (artisan) ---------------- */
.site-card { display: flex; flex-direction: column; gap: 14px; }
.site-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.site-card__name { font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.site-card__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.site-addr { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.site-addr > .grow { min-width: 150px; }
.site-addr svg { width: 18px; height: 18px; color: var(--primary-text); flex: none; }
.site-lot { padding: 12px; border-radius: 12px; background: var(--secondary-soft); }
.site-lot__name { font-weight: 700; font-size: 0.86rem; margin-bottom: 8px; color: var(--secondary-text); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.info-cell { font-size: 0.78rem; min-width: 0; }
.info-cell__k { color: var(--muted); font-size: 0.7rem; display: flex; align-items: center; gap: 5px; }
.info-cell__k svg { width: 13px; height: 13px; }
.info-cell__v { font-weight: 600; margin-top: 1px; overflow-wrap: anywhere; }
.access-box { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 12px; font-size: 0.78rem; display: grid; gap: 5px; }
.access-box b { font-weight: 600; }
.code-pill { font-family: var(--font-mono); background: var(--text); color: var(--bg); border-radius: 6px; padding: 1px 7px; font-weight: 700; letter-spacing: 0.08em; }

.week-agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-solid); padding: 9px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.week-day.is-today { border-color: var(--primary); box-shadow: var(--ring); }
.week-day__head { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: capitalize; display: flex; justify-content: space-between; }
.week-day.is-today .week-day__head { color: var(--primary-text); }
.week-ev { font-size: 0.72rem; padding: 6px 7px; border-radius: 8px; background: color-mix(in srgb, var(--ev, var(--primary)) 14%, transparent); border-left: 3px solid var(--ev, var(--primary)); line-height: 1.3; }
.week-ev b { display: block; font-weight: 700; }

/* ---------------- Calendrier mensuel (social) ---------------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface-solid); }
.cal__dow { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: center; }
.cal__cell { min-height: 108px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background var(--t-fast); }
.cal__cell:nth-child(7n) { border-right: 0; }
.cal__cell:hover { background: var(--primary-softer); }
.cal__cell.is-other { background: var(--surface-2); color: var(--subtle); }
.cal__cell.is-today .cal__num { background: var(--primary); color: #fff; }
.cal__num { font-size: 0.74rem; font-weight: 700; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal__post { font-size: 0.68rem; padding: 3px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal__post.is-published { background: var(--success-soft); color: var(--success-text); }
.cal__post.is-draft { background: var(--neutral-soft); color: var(--muted); }

.social-preview { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface-solid); }
.social-preview__head { display: flex; gap: 10px; align-items: center; padding: 12px; }
.social-preview__body { padding: 0 12px 12px; font-size: 0.84rem; white-space: pre-wrap; }
.social-preview__img { aspect-ratio: 16/9; background: var(--surface-3); display: grid; grid-template-columns: 1fr 1fr; }
.social-preview__img > div { display: grid; place-items: end start; padding: 10px; color: #fff; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em; }

/* ---------------- Check-lists (réglementation) ---------------- */
.check-section + .check-section { margin-top: var(--sp-5); }
.check-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.check-item + .check-item { margin-top: 7px; }
.check-item:hover { border-color: var(--border-strong); }
.check-item input { width: 19px; height: 19px; accent-color: var(--secondary); margin-top: 1px; flex: none; }
.check-item.is-done { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.check-item.is-done .check-item__label { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); }
.check-item__label { font-weight: 600; font-size: 0.85rem; }
.check-item__ref { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

/* ---------------- Divers ---------------- */
.divider { height: 1px; background: var(--border); margin: var(--sp-4) 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 0.85rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--surface-3); font-size: 0.76rem; font-weight: 600; }
.chip svg { width: 13px; height: 13px; }
.drag-chip { cursor: grab; border: 1px solid var(--border-strong); background: var(--surface-solid); padding: 8px 10px; border-radius: 12px; display: flex; align-items: center; gap: 10px; transition: box-shadow var(--t-fast), opacity var(--t-fast); }
.drag-chip:hover { box-shadow: var(--shadow-md); }
.drag-chip.is-blocked { opacity: 0.6; cursor: not-allowed; border-style: dashed; }
.drag-chip.is-dragging { opacity: 0.4; }
.lot-drop { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 10px 12px; transition: background var(--t-fast), border-color var(--t-fast); }
.lot-drop.is-over { background: var(--secondary-soft); border-color: var(--secondary); }
.lot-drop.is-over-blocked { background: var(--danger-soft); border-color: var(--danger); }
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary); animation: spin 0.8s linear infinite; display: inline-block; }
.meteo { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); }
.hero-client { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero-client__hello { font-size: var(--fs-2xl); font-family: var(--font-title); font-weight: 600; }
.log-console { font-family: var(--font-mono); font-size: 0.74rem; background: #0b1120; color: #cbd5e1; border-radius: 12px; padding: 12px 14px; max-height: 300px; overflow: auto; line-height: 1.7; }
.log-console .ok { color: #4ade80; } .log-console .err { color: #f87171; } .log-console .info { color: #60a5fa; } .log-console .ts { color: #64748b; }
.code-block { font-family: var(--font-mono); font-size: 0.75rem; background: var(--surface-3); border-radius: 10px; padding: 10px 12px; white-space: pre; overflow-x: auto; line-height: 1.6; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.offer > .btn--ghost { align-self: flex-start; padding-left: 0; }
.offer {
  border: 1.5px solid var(--border-strong); border-radius: 14px; padding: 16px; background: var(--surface-solid);
  display: flex; flex-direction: column; gap: 10px; position: relative;
}
.offer.is-best { border-color: var(--secondary); box-shadow: 0 0 0 4px var(--secondary-soft); }
.offer.is-validated { border-color: var(--success); background: var(--success-soft); }
.offer.is-refused { opacity: 0.55; }
.offer__ribbon { position: absolute; top: -10px; left: 14px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; background: var(--secondary); color: #fff; padding: 3px 9px; border-radius: 10px; }
.offer__price { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
