/* ============================================================
   Upon.top — Dashboard (refonte 2026)
   Chargé après styles.css + upon-brand.css : neutralise les
   règles Modernize sur la zone dashboard et impose la nouvelle
   charte (variables, pilules, typo Unbounded/Manrope).
   ============================================================ */

/* 1. Variables (sombre + clair) ------------------------------- */
/* Variables globales sur <html data-theme> pour que les modals (portés hors de .upd) y accèdent */
html[data-theme="dark"],
.upd,
.upd[data-theme="dark"] {
  --bg: #0E0E0E;
  --panel: #151515;
  --panel2: #1C1C1C;
  --line: #2A2A2A;
  --text: #FFFFFF;
  --soft: #CFCFCF;
  --muted: #9A9A9A;
  --field: #0E0E0E;
  --on-bg: #D7FF3A;
  --on-fg: #0E0E0E;
  --bar: #3A3A3A;
  --flash: #FF5C39;
  --shadow-pop: 0 12px 30px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

html[data-theme="light"],
.upd[data-theme="light"] {
  --bg: #F4F4EF;
  --panel: #FFFFFF;
  --panel2: #F4F4EF;
  --line: #E2E2DA;
  --text: #0E0E0E;
  --soft: #3A3A3A;
  --muted: #666666;
  --field: #FFFFFF;
  --on-bg: #0E0E0E;
  --on-fg: #D7FF3A;
  --bar: #0E0E0E;
  --flash: #E0441F;
  color-scheme: light;
}

/* 2. Reset ciblé sur la zone dashboard (annule Modernize) ---- */
.upd {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  transition: background .2s;
}

.upd *,
.upd *::before,
.upd *::after { box-sizing: border-box; }

.upd a { color: inherit; text-decoration: none; }
.upd a:hover { color: var(--flash); }

.upd button,
.upd input,
.upd select,
.upd textarea {
  font-family: inherit;
  color: inherit;
}

.upd h1, .upd h2, .upd h3, .upd h4 { margin: 0; }

.upd ::selection { background: var(--on-bg); color: var(--on-fg); }

/* Scrollbar discrète */
.upd ::-webkit-scrollbar { width: 10px; height: 10px; }
.upd ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.upd ::-webkit-scrollbar-track { background: transparent; }

/* 3. Logo brand -------------------------------------------- */
.upd-logo {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-family: 'Unbounded', sans-serif;
  font-size: 26px;
  line-height: 1;
}
.upd-logo__word {
  font-weight: 900;
  letter-spacing: -.04em;
  color: var(--on-bg);
}
.upd-logo__dot {
  font-weight: 700;
  font-size: .42em;
  color: var(--on-fg);
  background: var(--on-bg);
  padding: .2em .7em;
  border-radius: 999px;
  transform: rotate(-6deg);
  display: inline-block;
}
.upd-logo--square {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--on-bg);
  color: var(--on-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 22px;
}

/* 4. Overlays & drawer mobile ------------------------------ */
.upd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 49;
  display: none;
}
.upd[data-drawer="open"] .upd-overlay { display: block; }

/* 5. Sidebar ----------------------------------------------- */
.upd-side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex: none;
  box-sizing: border-box;
  height: 100vh;
  position: sticky;
  top: 0;
  width: 256px;
  z-index: 50;
}
.upd-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 22px 18px 18px;
}
.upd-side__close {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.upd-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 6px 12px 24px;
  flex: 1;
  overflow-y: auto;
}
.upd-nav__group { display: flex; flex-direction: column; gap: 4px; }
.upd-nav__cap {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 6px;
}
.upd-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: opacity .15s, background .15s;
}
.upd-nav__item:hover { opacity: .85; }
.upd-nav__item.is-active {
  background: var(--on-bg);
  color: var(--on-fg);
}
.upd-nav__item.is-active:hover { opacity: 1; color: var(--on-fg); }
.upd-nav__icon { flex: none; }
.upd-nav__label { flex: 1; }
.upd-nav__badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #FF5C39;
  color: #0E0E0E;
}
.upd-side__foot {
  padding: 14px 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upd-side__theme {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* 6. Zone principale (header + body) ----------------------- */
.upd-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.upd-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  flex-wrap: wrap;
}
.upd-head__hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.upd-head__title {
  margin: 0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upd-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.upd-pageselect {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.upd-pageselect__prefix {
  font-size: 13px;
  color: var(--muted);
}
.upd-pageselect select,
#upd-page-select {
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  max-width: 160px;
  padding: 6px 20px 6px 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 12px;
}
#upd-page-select option {
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}
.upd-pageselect__add {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: var(--on-bg);
  color: var(--on-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* Forcer la couleur du glyphe + : le cascade Bootstrap/vendor sur <path> peut
   écraser currentColor et faire disparaître le signe (noir sur noir en light,
   ou décalé en dark). On re-attache stroke sur --on-fg à chaque thème. */
.upd-pageselect__add svg,
.upd-pageselect__add svg path {
  color: var(--on-fg);
  stroke: var(--on-fg);
}
.upd-head__view {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.upd-head__profile {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.upd-head__profile img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.upd-body-wrap {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 28px 32px 48px;
  flex: 1;
}
.upd-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

/* 7. Composants réutilisables ------------------------------ */
.upd-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
}
.upd-card--kpi {
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upd-card--pad {
  padding: 24px;
}

/* Spécificité renforcée via sélecteurs d'attribut pour l'emporter sur Modernize (.btn.btn-primary etc.) sans !important */
.upd-btn,
button.upd-btn,
a.upd-btn,
label.upd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
  white-space: nowrap;
  line-height: 1;
  box-shadow: none;
}
.upd-btn:hover,
button.upd-btn:hover,
a.upd-btn:hover { opacity: .85; color: var(--text); background: transparent; }

.upd-btn.upd-btn--cta,
button.upd-btn.upd-btn--cta,
a.upd-btn.upd-btn--cta,
label.upd-btn.upd-btn--cta {
  background: var(--on-bg);
  color: var(--on-fg);
  border-color: transparent;
}
.upd-btn.upd-btn--cta:hover,
button.upd-btn.upd-btn--cta:hover,
a.upd-btn.upd-btn--cta:hover {
  color: var(--on-fg);
  background: var(--on-bg);
  opacity: .9;
}

.upd-btn.upd-btn--ghost,
button.upd-btn.upd-btn--ghost,
label.upd-btn.upd-btn--ghost {
  border: 1px dashed var(--line);
  color: var(--soft);
  background: transparent;
}
.upd-btn.upd-btn--danger { color: var(--flash); }
.upd-btn.upd-btn--sm,
button.upd-btn.upd-btn--sm { height: 36px; padding: 0 16px; font-size: 13px; }
.upd-btn.upd-btn--lg,
button.upd-btn.upd-btn--lg { height: 46px; padding: 0 26px; }

.upd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel2);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border: none;
  cursor: pointer;
}
.upd-chip--outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--soft);
}
.upd-chip--on {
  background: var(--on-bg);
  color: var(--on-fg);
  border-color: transparent;
}
.upd-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flash);
}
.upd-chip__num {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
}

.upd-pillbar {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.upd-pillbar .upd-pillbar__btn,
button.upd-pillbar__btn,
.upd-pillbar > button {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  box-shadow: none;
  text-decoration: none;
  margin: 0;
}
.upd-pillbar .upd-pillbar__btn.is-active,
.upd-pillbar .upd-pillbar__btn.active,
button.upd-pillbar__btn.active,
button.upd-pillbar__btn.is-active {
  background: var(--on-bg);
  color: var(--on-fg);
}
.upd-pillbar .upd-pillbar__btn:hover { background: transparent; color: var(--text); opacity: .85; }
.upd-pillbar .upd-pillbar__btn.active:hover,
.upd-pillbar .upd-pillbar__btn.is-active:hover { background: var(--on-bg); color: var(--on-fg); opacity: .9; }
.upd-pillbar--sm .upd-pillbar__btn { height: 36px; padding: 0 16px; font-size: 13px; }

.upd-field {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
}
.upd-field:focus {
  border-color: var(--on-bg);
}
.upd-field--textarea {
  padding: 12px 18px;
  border-radius: 20px;
  resize: vertical;
  min-height: 72px;
}
.upd-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.upd-label strong, .upd-label .upd-label__title { color: var(--text); }

.upd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.upd-grid--narrow {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.upd-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.upd-grid--kpi {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.upd-toggle {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  border: none;
  padding: 3px;
  background: var(--line);
  display: inline-flex;
  justify-content: flex-start;
  cursor: pointer;
  flex: none;
  transition: background .15s, justify-content .15s;
}
.upd-toggle__knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--muted);
  display: block;
  transition: background .15s;
}
.upd-toggle.is-on { background: var(--on-bg); justify-content: flex-end; }
.upd-toggle.is-on .upd-toggle__knob { background: var(--on-fg); }

.upd-color-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  cursor: pointer;
}
.upd-color-input input[type="color"] {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  padding: 0;
  background: none;
  cursor: pointer;
}
.upd-color-input__value {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.upd-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  outline: 2px solid transparent;
  outline-offset: 2px;
  cursor: pointer;
  padding: 0;
}
.upd-swatch.is-active { outline-color: var(--text); }

/* 8. Range slider ---------------------------------------- */
.upd input[type="range"] {
  width: 100%;
  accent-color: var(--on-bg);
  height: 28px;
}

/* 9. Toast ----------------------------------------------- */
.upd-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  z-index: 80;
  background: #D7FF3A;
  color: #0E0E0E;
  border: 2px solid #0E0E0E;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  max-width: calc(100vw - 40px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: transform .2s, opacity .2s;
}
.upd-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 10. Bouton Aperçu flottant ------------------------------ */
.upd-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 2px solid #0E0E0E;
  background: #D7FF3A;
  color: #0E0E0E;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

/* 11. Mes liens — carte profil ------------------------- */
.upd-profile {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.upd-profile__avatar {
  position: relative;
  width: 76px;
  height: 76px;
  flex: none;
  cursor: pointer;
}
.upd-profile__avatar img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.upd-profile__avatar .upd-profile__initial,
.upd-profile__initial {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--panel2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
}
.upd-profile__pencil {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--on-bg);
  color: var(--on-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--panel);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  pointer-events: none;
}
.upd-profile__body {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upd-profile__name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.upd-profile__name {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 20px;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--line);
  color: var(--text);
  outline: none;
  padding: 2px 0;
  min-width: 0;
  width: 240px;
  max-width: 100%;
}
.upd-profile__plan {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--on-bg);
  color: var(--on-fg);
  text-transform: uppercase;
}
.upd-profile__url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  width: fit-content;
}
.upd-profile__url:hover { color: var(--flash); }
.upd-profile__url span {
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
}
.upd-profile__socials {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.upd-profile__social {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  padding: 0;
  text-decoration: none;
  position: relative;
}
.upd-profile__social:hover { background: var(--panel2); }

/* 12. Liste des liens -------------------------------- */
.upd-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.upd-section-title h2 {
  margin: 0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 18px;
}
.upd-section-title h2 small {
  color: var(--muted);
  font-weight: 500;
}

.upd-link {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s;
}
.upd-link.is-dragging { opacity: .5; border-style: dashed; }
.upd-link.is-inactive .upd-link__row { opacity: .5; }
.upd-link__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.upd-link__handle {
  cursor: grab;
  color: var(--muted);
  display: flex;
  flex: none;
  padding: 4px;
}
.upd-link__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.upd-link__title {
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upd-link__host {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.upd-link__host:hover { color: var(--flash); }
.upd-link__dots {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.upd-link__dots:hover { background: var(--panel2); }
.upd-link__chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-left: 32px;
}
.upd-link__status {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.upd-menu {
  position: absolute;
  right: 14px;
  top: 58px;
  z-index: 20;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 180px;
  box-shadow: var(--shadow-pop);
}
.upd-menu.is-open { display: flex; }
.upd-menu__item {
  text-align: left;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.upd-menu__item:hover { background: var(--panel2); }
.upd-menu__item--danger { color: var(--flash); font-weight: 800; }

.upd-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 14px 0 2px 32px;
  flex-direction: column;
  gap: 10px;
}
.upd-panel.is-open { display: flex; }
.upd-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.upd-panel__hint {
  font-size: 13px;
  color: var(--muted);
}
.upd-panel__url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: var(--panel2);
}
.upd-panel__url span {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upd-empty {
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* 13. Personnaliser --------------------------------- */
.upd-headers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.upd-header-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.upd-header-opt.is-active { border-color: var(--on-bg); }
.upd-header-opt__thumb {
  width: 54px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  gap: 4px;
  position: relative;
}
.upd-header-opt__thumb .b-circle { width: 16px; height: 16px; border-radius: 50%; background: var(--text); margin-top: 10px; flex: none; }
.upd-header-opt__thumb .b-dash { width: 26px; height: 4px; border-radius: 2px; background: var(--muted); flex: none; }
.upd-header-opt__thumb .b-line { width: 40px; height: 7px; border-radius: 4px; background: var(--line); flex: none; }
.upd-header-opt__thumb .b-banner { width: 100%; height: 20px; background: var(--muted); flex: none; }
.upd-header-opt__thumb .b-circle--overlay { margin-top: -9px; border: 2px solid var(--panel); }
.upd-header-opt__thumb .b-row-left { display: flex; gap: 4px; align-items: center; width: 40px; margin-top: 10px; }
.upd-header-opt__thumb .b-small-circle { width: 12px; height: 12px; border-radius: 50%; background: var(--text); flex: none; }
.upd-header-opt__thumb .b-small-dash { width: 20px; height: 4px; border-radius: 2px; background: var(--muted); flex: none; }
.upd-header-opt__thumb .b-left-line { width: 40px; height: 7px; border-radius: 2px; background: var(--line); flex: none; }
.upd-header-opt__thumb .b-photo { width: 100%; height: 38px; background: var(--muted); display: flex; align-items: flex-end; padding: 3px; box-sizing: border-box; flex: none; }
.upd-header-opt__thumb .b-photo-tag { width: 22px; height: 5px; background: var(--text); border-radius: 1px; }
.upd-header-opt__thumb .b-title { width: 40px; height: 9px; border-radius: 2px; background: var(--text); margin-top: 12px; flex: none; }
.upd-header-opt__thumb .b-title--second { margin-top: -2px; }
.upd-header-opt__thumb .b-card { width: 44px; height: 34px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--line); margin-top: 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 4px; box-sizing: border-box; flex: none; }
.upd-header-opt__thumb .b-card-circle { width: 10px; height: 10px; border-radius: 50%; background: var(--text); flex: none; }
.upd-header-opt__thumb .b-card-actions { display: flex; gap: 2px; }
.upd-header-opt__thumb .b-card-action { width: 14px; height: 4px; border-radius: 2px; background: var(--text); flex: none; }
.upd-header-opt__thumb .b-card-action--outline { background: transparent; border: 1px solid var(--text); box-sizing: border-box; }
.upd-header-opt__thumb .b-arch { width: 20px; height: 26px; border-radius: 10px 10px 3px 3px; background: var(--text); margin-top: 7px; flex: none; }
.upd-header-opt__thumb .b-brand-banner { width: 100%; height: 26px; background: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.upd-header-opt__thumb .b-brand-logo { width: 20px; height: 9px; border: 1px dashed var(--text); border-radius: 2px; }
.upd-header-opt__thumb .b-brand-chips { display: flex; gap: 2px; }
.upd-header-opt__thumb .b-brand-chip { width: 16px; height: 5px; border-radius: 3px; background: var(--line); flex: none; }
.upd-header-opt__thumb .b-brand-chip--small { width: 12px; }
.upd-header-opt__name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.upd-extra {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel2);
}

/* 14. Aperçu téléphone ------------------------------ */
.upd-preview-wrap {
  position: sticky;
  top: 96px;
  flex: none;
  width: 340px;
  display: flex;
  flex-direction: column;
}
.upd-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.upd-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.upd-preview__title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.upd-preview__close {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.upd-phone {
  width: 100%;
  height: min(600px, calc(100vh - 260px));
  border: 8px solid #2A2A2A;
  border-radius: 42px;
  overflow: hidden;
  box-sizing: border-box;
  background: #0E0E0E;
}
.upd-phone__iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0E0E0E;
}
.upd-preview__actions {
  display: flex;
  gap: 8px;
}

/* 15. Statistiques ---------------------------------- */
.upd-kpi__label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.upd-kpi__value {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -.02em;
}
.upd-kpi__delta {
  font-size: 12px;
  font-weight: 800;
  color: var(--flash);
}

.upd-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.upd-chart__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.upd-chart__head h2 {
  margin: 0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.upd-chart__caption {
  font-size: 13px;
  color: var(--muted);
}
.upd-chart__bars {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.upd-chart__bars--dense { gap: 3px; }
.upd-chart__bar {
  flex: 1;
  min-width: 0;
  background: var(--bar);
  border-radius: 6px 6px 2px 2px;
  box-sizing: border-box;
  transition: opacity .15s;
}
.upd-chart__bar--last {
  background: #D7FF3A;
  border: 2px solid #0E0E0E;
}
.upd-chart__legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.upd-stat-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.upd-stat-list h2 {
  margin: 0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.upd-stat-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upd-stat-row__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}
.upd-stat-row__title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upd-stat-row__value {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.upd-stat-row__muted { color: var(--muted); font-weight: 500; }
.upd-stat-row__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--panel2);
  overflow: hidden;
}
.upd-stat-row__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--bar);
}
.upd-devices-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  gap: 3px;
}
.upd-devices-bar__seg {
  background: var(--bar);
}
.upd-devices-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.upd-devices-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line);
  flex: none;
}
.upd-devices-row__label { flex: 1; font-weight: 700; }

/* 16. Dropdown-menu (compat Bootstrap pour profil/pages) --- */
.upd .dropdown-menu {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  box-shadow: var(--shadow-pop);
  color: var(--text);
}
.upd .dropdown-item {
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
}
.upd .dropdown-item:hover,
.upd .dropdown-item:focus { background: var(--panel2); color: var(--text); }

/* 16b. Bootstrap compat : cards, forms, nav-pills, alerts ---- */
.upd .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
}
.upd .card.bg-light,
.upd .card.bg-light-info,
.upd .card.bg-light-success,
.upd .card.bg-light-warning,
.upd .card.bg-light-danger {
  background: var(--panel2) !important;
  border-color: var(--line);
}
.upd .card-body { color: var(--text); }
.upd .card-title { color: var(--text); font-family: 'Unbounded', sans-serif; font-weight: 700; }

.upd .form-label { color: var(--soft); font-weight: 700; font-size: 13px; }
.upd .form-control,
.upd .form-select {
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}
.upd .form-control:focus,
.upd .form-select:focus {
  background: var(--field);
  color: var(--text);
  border-color: var(--on-bg);
  box-shadow: none;
}
.upd textarea.form-control { border-radius: 18px; }
.upd .form-range { accent-color: var(--on-bg); }
.upd .form-control-color { padding: 4px; height: 46px; border-radius: 999px; }
.upd .form-text { color: var(--muted); font-size: 12px; }

.upd .text-muted { color: var(--muted) !important; }
.upd .text-primary { color: var(--on-bg) !important; }
.upd .text-danger { color: var(--flash) !important; }
.upd .text-warning { color: var(--flash) !important; }
.upd .text-success { color: var(--on-bg) !important; }

.upd .btn-primary,
.upd .btn-info,
.upd .btn-success,
.upd .btn-warning {
  background: var(--on-bg);
  border-color: transparent;
  color: var(--on-fg);
  border-radius: 999px;
  font-weight: 800;
  padding: 10px 20px;
}
.upd .btn-primary:hover,
.upd .btn-info:hover,
.upd .btn-success:hover,
.upd .btn-warning:hover { background: var(--on-bg); color: var(--on-fg); opacity: .85; }
.upd .btn-outline-primary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  font-weight: 800;
}
.upd .btn-light,
.upd .btn-light-primary,
.upd .btn-light-info,
.upd .btn-light-success,
.upd .btn-light-warning {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
}
.upd .btn-light-danger,
.upd .btn-danger {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--flash);
  border-radius: 999px;
}

.upd .nav-pills .nav-link {
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  padding: 10px 18px;
}
.upd .nav-pills .nav-link.active {
  background: var(--on-bg);
  color: var(--on-fg);
}

.upd .alert {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.upd .alert-info { background: var(--panel2); color: var(--text); }
.upd .alert-success { color: var(--on-bg); }
.upd .alert-danger { color: var(--flash); }

.upd .badge { font-weight: 800; }
.upd hr { border-color: var(--line); opacity: 1; }

/* Section customize : affichage conditionnel géré par JS externe */
.upd .customize-section { display: none; }
.upd .customize-section.active,
.upd #section-header { display: block; } /* fallback si JS n'est pas encore passé */

/* 17. Modal (compat Bootstrap) — accessible depuis html[data-theme] car Bootstrap porte le modal hors de .upd */
.upd-modal-sync .modal-content {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.upd-modal-sync .modal-header,
.upd-modal-sync .modal-footer { border-color: var(--line); }
.upd-modal-sync .modal-title { color: var(--text); font-family: 'Unbounded', sans-serif; font-weight: 700; }
.upd-modal-sync .btn-close { filter: var(--btn-close-filter, invert(1)); }
.upd-modal-sync .form-label { color: var(--soft); font-weight: 700; font-size: 13px; }
.upd-modal-sync .form-control,
.upd-modal-sync .form-select {
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
}
.upd-modal-sync .form-control:focus,
.upd-modal-sync .form-select:focus {
  background: var(--field);
  color: var(--text);
  border-color: var(--on-bg);
  box-shadow: none;
}
.upd-modal-sync textarea.form-control { border-radius: 16px; }
.upd-modal-sync .input-group-text {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px 0 0 999px;
}
.upd-modal-sync .input-group .form-control { border-radius: 0 999px 999px 0; }
.upd-modal-sync .alert { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 16px; }
.upd-modal-sync .alert-info { color: var(--text); }
.upd-modal-sync .alert-danger { color: var(--flash); }
.upd-modal-sync .text-muted { color: var(--muted) !important; }
.upd-modal-sync .nav-pills .nav-link { color: var(--text); background: transparent; border-radius: 999px; }
.upd-modal-sync .nav-pills .nav-link.active { background: var(--on-bg); color: var(--on-fg); }

html[data-theme="light"] .upd-modal-sync .btn-close { filter: none; }

/* 18. Responsive ------------------------------------------- */
@media (max-width: 1279px) {
  .upd-preview-wrap {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 60;
    background: rgba(0, 0, 0, .7);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  .upd[data-preview="open"] .upd-preview-wrap { display: flex; }
  .upd-preview { width: 340px; }
  .upd-preview__close { display: inline-flex; }
  .upd-fab { display: inline-flex; }
}

@media (max-width: 1099px) {
  .upd-side { width: 84px; }
  .upd-nav__cap { display: none; }
  .upd-nav__label,
  .upd-nav__badge,
  .upd-side__theme span,
  .upd-logo { display: none; }
  .upd-logo--square { display: flex; }
  .upd-nav__item { justify-content: center; padding: 0; }
  .upd-side__theme { justify-content: center; padding: 0; }
}

@media (min-width: 1100px) {
  .upd-logo--square { display: none; }
}

@media (max-width: 719px) {
  .upd-side {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 284px;
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  .upd[data-drawer="open"] .upd-side { transform: translateX(0); }
  .upd-side__close { display: inline-flex; }
  .upd-logo { display: inline-flex; }
  .upd-logo--square { display: none; }
  .upd-nav__cap { display: block; }
  .upd-nav__label,
  .upd-nav__badge,
  .upd-side__theme span { display: inline; }
  .upd-nav__item { justify-content: flex-start; padding: 0 14px; }
  .upd-side__theme { justify-content: flex-start; padding: 0 14px; }
  .upd-head { padding: 12px 16px; }
  .upd-head__title { font-size: 18px; }
  .upd-head__hamburger { display: inline-flex; }
  .upd-head__view { display: none; }
  .upd-body-wrap { padding: 18px 14px 96px; gap: 16px; }
}

@media (min-width: 720px) and (max-width: 1099px) {
  .upd-body-wrap { padding: 24px 24px 96px; gap: 20px; }
}

/* 19. Masque les éléments Modernize résiduels + reset wrappers ---- */
.dark-transparent.sidebartoggler { display: none !important; }
body > .preloader { display: none !important; }

/* Les wrappers Modernize sont neutralisés : la .upd prend tout l'espace */
.upd-wrapper-reset {
  display: contents;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------------
   Neutralise les classes Modernize qui portent du background/color
   figé sur #links-container, les .link-item .card.img-task et leurs
   enfants. Essentiel : au toggle de thème, ces classes retiennent
   leur couleur d'origine (indépendante de --panel) → bascule cassée.
   ------------------------------------------------------------------ */
.upd #links-container,
.upd #links-container.scrumboard,
.upd #links-container.task-list-section,
.upd #links-container.connect-sorting,
.upd #links-container.connect-sorting-content {
  background: transparent;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border: none;
}

.upd .link-item,
.upd .link-item.card,
.upd .link-item.img-task,
.upd .link-item.card.img-task {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}
.upd .link-item .card-body,
.upd .link-item .task-header,
.upd .link-item .task-content,
.upd .link-item .task-body,
.upd .link-item .task-bottom,
.upd .link-item .tb-section-1,
.upd .link-item .tb-section-2 {
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  border: none;
}
.upd .upd-section-title h2,
.upd .upd-section-title h2 small {
  color: var(--text);
}
.upd .upd-section-title h2 small { color: var(--muted); }
