/* ==========================================================================
   Chez Alix — espace employé
   Les couleurs et polices (variables ci-dessous) sont écrasées au chargement
   par les réglages enregistrés depuis « Apparence & réglages ».
   ========================================================================== */

:root {
  --bg: #F9ECDE;
  --surface: #FFF9F2;
  --primary: #2F4B37;
  --accent: #E7B3A5;
  --sage: #9DB48F;
  --wood: #8B5E3C;
  --text: #2B3A2F;
  --on-primary: #FFF9F2;
  --on-accent: #1F2A22;

  --font-script: 'Dancing Script', cursive;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Nunito', system-ui, sans-serif;

  --muted: color-mix(in srgb, var(--text) 74%, var(--bg));
  --line: color-mix(in srgb, var(--primary) 14%, var(--bg));
  --line-strong: color-mix(in srgb, var(--primary) 28%, var(--surface));
  --soft-accent: color-mix(in srgb, var(--accent) 30%, var(--surface));
  --soft-sage: color-mix(in srgb, var(--sage) 28%, var(--surface));
  --field-bg: color-mix(in srgb, var(--surface) 65%, white);
  --danger: #B0483F;

  --radius: 20px;
  --r-ctl: 14px;
  --r-pill: 999px;
  --r-modal: 26px;
  --page-w: 1200px;
  --shadow: 0 1px 2px rgba(80, 55, 30, .06), 0 10px 28px -14px rgba(80, 55, 30, .28);
  --shadow-lg: 0 2px 6px rgba(80, 55, 30, .08), 0 24px 48px -18px rgba(80, 55, 30, .38);
  --sidebar-w: 292px;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

[data-blobs='off'] body::before { display: none; }

/* Grandes taches douces en fond, comme dans l'illustration */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48% 42% at 100% 0%, color-mix(in srgb, var(--accent) 48%, transparent), transparent 72%),
    radial-gradient(44% 38% at 0% 0%, color-mix(in srgb, var(--sage) 38%, transparent), transparent 72%),
    radial-gradient(40% 36% at 100% 100%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 72%);
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-heading); color: var(--primary); line-height: 1.2; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 60%, var(--sage));
  outline-offset: 2px;
  border-radius: 8px;
}

.script { font-family: var(--font-script); font-weight: 700; color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.block { display: block; }

/* ============================ Structure ============================ */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar { grid-column: 1; grid-row: 1; }
.main { grid-column: 2; grid-row: 1; min-width: 0; }
.topbar { display: none; }
.scrim { display: none; }

.page { max-width: var(--page-w, 1200px); margin: 0 auto; padding: 2.25rem 1.75rem 5rem; }

/* ============================ Menu latéral ============================ */

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 1rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  padding: 0 .5rem 1.1rem;
}
.brand-logo {
  width: 124px;
  height: 124px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 8px 14px rgba(80, 55, 30, .22));
}
.brand-name { font-size: 2.1rem; line-height: 1; margin-top: .25rem; }
.brand-sub {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  justify-content: center;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.brand-sub::before, .brand-sub::after { content: ''; height: 1px; flex: 1; max-width: 28px; background: var(--line-strong); }

.nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: .15rem; margin-top: .55rem; }
.nav-title {
  margin: .7rem .75rem .25rem;
  font: 700 .68rem/1.3 var(--font-body);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .8rem;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--soft-sage); }
.nav-link.active { background: var(--primary); color: var(--on-primary); }
.nav-emoji { width: 1.5rem; text-align: center; font-size: 1.15rem; flex: none; }
.nav-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge-count {
  min-width: 1.5rem;
  padding: 0 .45rem;
  text-align: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: .78rem;
  font-weight: 800;
}
.nav-hidden { font-size: .68rem; padding: .05rem .45rem; border-radius: var(--r-pill); background: var(--soft-accent); color: var(--text); font-weight: 700; }
.nav-link.active .nav-hidden { background: color-mix(in srgb, var(--on-primary) 22%, transparent); color: var(--on-primary); }

.user-card {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.user-link { display: flex; align-items: center; gap: .65rem; flex: 1; min-width: 0; padding: .35rem; border-radius: 14px; text-decoration: none; color: var(--text); }
.user-link:hover { background: var(--soft-sage); }
.user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-info strong, .user-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info small { color: var(--muted); }

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 1rem var(--font-heading);
}
.avatar.sm { width: 32px; height: 32px; font-size: .9rem; }
.avatar.lg { width: 68px; height: 68px; font-size: 1.6rem; }

/* ============================ En-têtes de page ============================ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.page-head h1 { font-size: clamp(2.1rem, 4.2vw, 2.9rem); line-height: 1.1; }
.title-emoji { font-family: var(--font-body); font-size: .8em; }
.lead { margin-top: .35rem; color: var(--muted); max-width: 62ch; }

.notice {
  padding: .8rem 1.1rem;
  border-radius: 16px;
  background: var(--soft-sage);
  border: 1px solid color-mix(in srgb, var(--sage) 45%, transparent);
  margin-bottom: 1.25rem;
}
.notice-warn { background: var(--soft-accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.notice.inline { display: inline-block; margin: 0; text-decoration: none; font-weight: 700; }
.notice.inline:hover { filter: brightness(.97); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 42px;
  padding: .55rem 1.2rem;
  border: 0;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, filter .15s, background .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: .3rem .85rem; font-size: .85rem; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 14px -8px var(--primary); }
.btn-soft { background: var(--soft-sage); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover:not(:disabled) { background: var(--soft-sage); filter: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); color: color-mix(in srgb, var(--danger) 85%, black); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--soft-sage); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); }

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

.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field-label { font-weight: 700; font-size: .9rem; }
.field-hint { color: var(--muted); font-size: .82rem; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=url], input[type=search], input[type=email], input[type=tel], select, textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--field-bg);
  min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage) 45%, transparent);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
select.select-sm { min-height: 36px; padding: .3rem .6rem; width: auto; }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.row.icon-title { grid-template-columns: 110px 1fr; }
.icon-input { text-align: center; font-size: 1.4rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.two-col.align-start { align-items: start; }

.check { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.check.block { align-items: flex-start; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--field-bg); }
.check.block input { margin-top: .2rem; }
.check.block span { display: flex; flex-direction: column; font-weight: 400; }
.check.block small { color: var(--muted); }
.check.small { font-size: .85rem; white-space: nowrap; }
.checks { display: grid; gap: .5rem; }

.form-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: .25rem; }
.form-error {
  padding: .65rem .9rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: color-mix(in srgb, var(--danger) 85%, black);
  font-weight: 600;
  font-size: .92rem;
}
.form-h { font-size: 1.15rem; margin-top: .75rem; padding-top: .9rem; border-top: 1px solid var(--line); }

.input-group { display: flex; gap: .5rem; align-items: center; }

.image-picker { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.img-preview {
  width: 140px;
  height: 92px;
  border-radius: 14px;
  border: 1.5px dashed var(--line-strong);
  background: var(--field-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
}
.img-preview img { width: 100%; height: 100%; object-fit: contain; }
.img-preview.empty { border-style: dashed; }
.image-picker-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .25rem; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .35rem .2rem .8rem; border-radius: var(--r-pill); background: var(--soft-sage); font-weight: 700; font-size: .88rem; color: var(--primary); }
.tag button { border: 0; background: transparent; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; color: inherit; font-size: 1.1rem; line-height: 1; }
.tag button:hover { background: color-mix(in srgb, var(--primary) 15%, transparent); }

.emoji-row { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: -.4rem; }
.emoji-btn { border: 0; background: transparent; border-radius: 10px; width: 36px; height: 36px; font-size: 1.2rem; cursor: pointer; }
.emoji-btn:hover { background: var(--soft-sage); }

.fields-editor { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.field-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
  gap: .5rem;
  align-items: center;
  padding: .65rem;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
}
.fr-actions { display: flex; }
.fr-options { grid-column: 1 / -1; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; }
.radio-cards.stack { grid-template-columns: 1fr; }
.radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .8rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.radio-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-card:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 60%, var(--sage)); outline-offset: 2px; }
.radio-card.checked { border-color: var(--primary); background: var(--soft-sage); box-shadow: 0 0 0 1px var(--primary) inset; }
.radio-card small { color: var(--muted); }
.radio-card .sample { font-size: 1.9rem; line-height: 1.15; color: var(--primary); font-weight: 700; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .7rem; margin-top: 1rem; }
.color-item { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--field-bg); cursor: pointer; }
.color-item input[type=color] { width: 46px; height: 46px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; flex: none; }
.color-item input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-item input[type=color]::-webkit-color-swatch { border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--line-strong); }
.color-item input[type=color]::-moz-color-swatch { border: 2px solid var(--surface); border-radius: 50%; }
.color-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.color-text small { color: var(--muted); }
.color-item code { color: var(--muted); }

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1.5rem;
  padding: 1.2rem 0 1rem;
  background: linear-gradient(to bottom, transparent, var(--bg) 35%);
}
.save-actions { display: flex; justify-content: flex-end; gap: .6rem; }

/* ============================ Cartes & composants ============================ */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 1.35rem 1.5rem; margin-bottom: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.more { font-weight: 700; font-size: .9rem; text-decoration: none; }
.more:hover { text-decoration: underline; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: .12rem .7rem;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  width: fit-content;
}
.chip-sage { background: var(--soft-sage); color: var(--primary); }
.chip-ok { background: #DDEEDD; color: #1E5A35; }
.chip-warn { background: #F8E7BE; color: #6F4C00; }
.chip-bad { background: #F6D5D0; color: #8A2E25; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.seg { display: inline-flex; padding: .25rem; border-radius: var(--r-pill); background: var(--soft-sage); }
.seg-btn { border: 0; background: transparent; padding: .4rem 1rem; border-radius: var(--r-pill); font-weight: 700; cursor: pointer; color: var(--primary); }
.seg-btn.active { background: var(--primary); color: var(--on-primary); }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; max-width: 320px; color: var(--muted); }
.search svg { position: absolute; left: .85rem; pointer-events: none; }
.search input { padding-left: 2.6rem; border-radius: var(--r-pill); }
.chips-filter { display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; }
.filter-chip { border: 1.5px solid var(--line-strong); background: var(--field-bg); color: var(--primary); border-radius: var(--r-pill); padding: .3rem .95rem; font-weight: 700; font-size: .88rem; cursor: pointer; }
.filter-chip:hover { background: var(--soft-sage); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* Cartes d'événements */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.event-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-card:has(.stretched:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 60%, var(--sage)); outline-offset: 2px; }
.event-card.is-past .card-media { filter: grayscale(.55); opacity: .85; }
.card-media { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--soft-sage), var(--soft-accent)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; }
.date-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: .3rem .5rem;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  line-height: 1;
  box-shadow: 0 6px 14px -6px rgba(80, 55, 30, .45);
}
.db-day { font: 700 1.5rem var(--font-heading); }
.db-month { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-top: .15rem; }
.pin-flag { position: absolute; top: .6rem; right: .7rem; font-size: 1.2rem; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.card-body { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.2rem 1.2rem; flex: 1; }
.card-title { font-size: 1.35rem; }
.stretched { all: unset; cursor: pointer; font: inherit; color: inherit; }
.stretched::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.meta { color: var(--muted); font-weight: 600; font-size: .92rem; }
.meta.big { font-size: 1.02rem; margin: .25rem 0 .5rem; }
.excerpt { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.facts.big { font-size: 1rem; padding: .85rem 1rem; border-radius: 16px; background: var(--soft-sage); margin-bottom: 1rem; }

.signup { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem; }
.signup-info { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 700; }
.meter { width: 96px; height: 6px; border-radius: var(--r-pill); background: var(--soft-sage); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* Fil d'annonces */
.feed { display: flex; flex-direction: column; gap: 1.1rem; max-width: 820px; }
.post { padding: 1.35rem 1.5rem; display: flex; flex-direction: column; gap: .55rem; }
.post.pinned { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; }
.post-actions { margin-left: auto; display: flex; }
.pin-tag { font-size: .8rem; font-weight: 800; color: var(--wood); }
.post-title { font-size: 1.6rem; }
.post-img { border-radius: 16px; max-height: 420px; object-fit: cover; width: 100%; }

.rich { line-height: 1.65; overflow-wrap: anywhere; }
.rich p { margin: 0 0 .6em; }
.rich p:last-child, .rich ul:last-child { margin-bottom: 0; }
.rich ul { margin: 0 0 .6em; padding-left: 1.3em; }
.rich li::marker { color: var(--accent); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; padding: .8rem 1rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--sage) 10%, transparent); }
.table tr.is-past { opacity: .65; }
.cell-title { font-weight: 700; min-width: 180px; }
.table td[data-label="Date"], .table td[data-label="Inscrit le"], .table td[data-label="Dernière connexion"] { white-space: nowrap; }
.cell-actions { white-space: nowrap; text-align: right; }
.cell-actions.wide .btn { margin-left: .25rem; }
.link-btn { all: unset; cursor: pointer; font-weight: 700; color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 30%, transparent); text-underline-offset: 3px; }
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, var(--sage)); outline-offset: 2px; }
.who { display: inline-flex; align-items: center; gap: .65rem; }

/* Vide / chargement */
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.empty-emoji { font-size: 3rem; }
.empty h3 { font-size: 1.5rem; }
.empty .btn { margin-top: .75rem; }
.loading { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 4rem 1rem; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--soft-sage); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ Fenêtres ============================ */

dialog.modal {
  width: 100%;
  max-width: min(560px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
dialog.modal.wide { max-width: min(780px, calc(100vw - 1.5rem)); }
dialog.modal[open] { animation: pop .2s ease-out; }
dialog.modal::backdrop { background: rgba(40, 32, 24, .48); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-card:focus { outline: none; }
.modal-card { display: flex; flex-direction: column; max-height: calc(100dvh - 1.5rem); background: var(--surface); border-radius: var(--r-modal); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.35rem; }
.modal-body { padding: 1.4rem 1.5rem 1.6rem; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--sage) 8%, var(--surface)); }
.confirm-text { line-height: 1.6; }

.detail { display: flex; flex-direction: column; gap: .5rem; }
.detail-img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 18px; margin-bottom: .5rem; }
.detail-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.detail-title { font-size: 2rem; }
.detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .75rem; border-top: 1px solid var(--line); margin-top: .5rem; }
.participants { margin: .75rem 0; padding: 1rem 1.1rem; border-radius: 18px; background: var(--soft-accent); display: flex; flex-direction: column; gap: .6rem; }
.participants h4 { font-size: 1.15rem; }
.participants .signup { margin-top: 0; padding-top: 0; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.people li { display: inline-flex; align-items: center; gap: .1rem; padding: .1rem .2rem .1rem .8rem; border-radius: var(--r-pill); background: var(--surface); font-weight: 600; font-size: .9rem; }
.people li .icon-btn { width: 28px; height: 28px; }
.people li:not(:has(.icon-btn)) { padding-right: .8rem; }

.toasts { position: fixed; z-index: 100; left: 50%; bottom: 1.25rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: .7rem 1.2rem; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-weight: 700; box-shadow: var(--shadow-lg); animation: rise .25s ease-out; text-align: center; }
.toast-error { background: var(--danger); color: #fff; border-radius: 18px; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ============================ Accueil ============================ */

.hero { height: clamp(200px, 32vw, 360px); border-radius: 30px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: var(--surface); margin-bottom: 1.25rem; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.greeting { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; padding: 1.5rem 1.75rem; margin-bottom: 1.25rem; }
.greeting h1 { font-size: clamp(2rem, 4vw, 2.7rem); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; }
.home-grid .panel { margin-bottom: 0; }
.rows { display: flex; flex-direction: column; gap: .25rem; }
.row-link { display: flex; align-items: center; gap: .9rem; padding: .6rem .6rem; margin: 0 -.6rem; border-radius: 16px; text-decoration: none; color: var(--text); }
.row-link:hover { background: var(--soft-sage); }
.row-link .date-badge { position: static; flex: none; box-shadow: none; }
.row-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.row-main strong { overflow-wrap: anywhere; }
.row-main small { color: var(--muted); }
.row-link.stacked { align-items: flex-start; }

.quick { margin-top: 2.25rem; }
.quick-title { font-size: 1.5rem; margin-bottom: .9rem; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.quick-card { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; padding: 1.1rem 1.2rem; text-decoration: none; color: var(--text); transition: transform .18s, box-shadow .18s; }
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.quick-card strong { font: 700 1.2rem var(--font-heading); color: var(--primary); }
.quick-card small { color: var(--muted); line-height: 1.4; }
.quick-emoji { font-size: 1.9rem; }

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

.month-nav { display: flex; align-items: center; gap: .35rem; }
.month-label { min-width: 10ch; text-align: center; font: 700 1.3rem var(--font-heading); color: var(--primary); text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; margin-bottom: 1.5rem; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: .3rem 0; }
.cal-cell { position: relative; min-height: 100px; padding: .4rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-cell.out { background: transparent; border-color: transparent; }
.cal-cell.today { border: 2px solid var(--accent); background: var(--soft-accent); }
.cal-num { font-weight: 800; font-size: .85rem; color: var(--muted); }
.cal-cell.today .cal-num { color: var(--text); }
.cal-ev { display: block; padding: .1rem .45rem; border-radius: 8px; background: var(--soft-sage); color: var(--primary); font-size: .74rem; font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev:hover { background: var(--sage); }
.cal-more { font-size: .72rem; font-weight: 800; color: var(--muted); padding-left: .3rem; }
.cal-dot { display: none; }
.agenda-list { padding: .5rem 1.5rem 1rem; }
.agenda-day h3 { font-size: 1.1rem; text-transform: capitalize; margin: 1rem 0 .3rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.agenda-item { display: grid; grid-template-columns: 80px 1fr auto; gap: .75rem; align-items: baseline; padding: .5rem .4rem; border-radius: 12px; text-decoration: none; color: var(--text); }
.agenda-item:hover { background: var(--soft-sage); }
.agenda-time { color: var(--muted); font-weight: 700; font-size: .9rem; }
.agenda-title { font-weight: 700; }
.agenda-item small { color: var(--muted); }

/* ============================ Gestion ============================ */

.section-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.section-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .9rem 1rem; padding: .8rem 1rem; }
.sr-icon { font-size: 1.7rem; width: 2.4rem; text-align: center; }
.sr-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.sr-main strong { font: 700 1.2rem var(--font-heading); color: var(--primary); }
.sr-main small { color: var(--muted); }
.sr-badges { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.sr-actions { display: flex; }

.pending-panel { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.user-row { display: flex; align-items: center; gap: .9rem; padding: .5rem 0; flex-wrap: wrap; }
.ur-main { display: flex; flex-direction: column; flex: 1; min-width: 180px; line-height: 1.3; }
.ur-main small { color: var(--muted); }
.ur-actions { display: flex; gap: .4rem; }
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-head > div { display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; }

/* ============================ Connexion ============================ */

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(400px, 1fr); }
.auth.no-art { grid-template-columns: minmax(0, 1fr); }

/* Illustration entière (lapin, tasse, gâteau…) qui se fond dans la page sur ses bords */
.auth-art { position: sticky; top: 0; align-self: start; height: 100dvh; display: grid; place-items: center; overflow: hidden; padding: 1.5rem 0 1.5rem 1rem; }
.auth-art-img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 3rem);
  width: auto;
  height: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 13%, #000 87%, transparent), linear-gradient(to right, transparent, #000 5%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 13%, #000 87%, transparent), linear-gradient(to right, transparent, #000 5%, #000 86%, transparent);
  mask-composite: intersect;
  animation: art-in .9s ease-out both, art-float 11s ease-in-out .9s infinite alternate;
}
@keyframes art-in { from { opacity: 0; transform: translateX(-14px) scale(.985); } }
@keyframes art-float { to { transform: translateY(-7px); } }

/* Petits cœurs et fleurs qui montent doucement */
.floaty {
  position: absolute;
  bottom: -2rem;
  left: calc(8% + var(--i) * 15%);
  font-size: calc(1rem + var(--i) * .18rem);
  color: color-mix(in srgb, var(--accent) 85%, var(--wood));
  opacity: 0;
  pointer-events: none;
  animation: floaty calc(15s + var(--i) * 2.5s) linear calc(var(--i) * -3.2s) infinite;
}
.floaty:nth-of-type(even) { color: color-mix(in srgb, var(--sage) 90%, var(--primary)); }
@keyframes floaty {
  0% { transform: translateY(0) rotate(-8deg); opacity: 0; }
  12% { opacity: .55; }
  85% { opacity: .45; }
  100% { transform: translateY(-105dvh) rotate(14deg); opacity: 0; }
}

.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; padding: 2rem 1.5rem 2rem .5rem; }
.auth.no-art .auth-panel { padding: 2rem 1.5rem; }
.auth-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin-top: 66px;
  padding: 82px 2rem 2.25rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--surface) 70%, var(--line));
  border-radius: 34px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: card-in .6s .1s ease-out both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
/* Le logo est posé à cheval sur le bord haut de la carte */
.auth-logo {
  position: absolute;
  top: -66px;
  left: 50%;
  width: 132px;
  height: 132px;
  transform: translateX(-50%);
  object-fit: contain;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 6px var(--surface), 0 14px 26px -8px rgba(80, 55, 30, .4);
}
.auth-title { text-align: center; font-size: 2.5rem; line-height: 1.1; }
.auth-card .lead { text-align: center; margin: -.4rem auto 0; font-size: .95rem; }
.auth-footer { color: var(--muted); font-size: .85rem; text-align: center; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: .25rem; border-radius: var(--r-pill); background: var(--soft-sage); }
.tab { border: 0; background: transparent; padding: .55rem; border-radius: var(--r-pill); font-weight: 800; color: var(--primary); cursor: pointer; transition: background .15s, color .15s; }
.tab.active { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 14px -8px var(--primary); }

/* ============================ Tablette & mobile ============================ */

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { grid-column: 1; grid-row: 2; }
  .page { padding: 1.25rem 1rem 4.5rem; }

  .topbar {
    grid-column: 1; grid-row: 1;
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: .5rem;
    height: 58px; padding: 0 .75rem;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-brand { font-size: 1.7rem; text-decoration: none; }

  .sidebar {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0;
    width: min(86vw, 320px); height: 100dvh;
    transform: translateX(-102%);
    transition: transform .25s ease;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
  }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open { overflow: hidden; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(40, 32, 24, .45); }

  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { position: relative; height: auto; padding: 0; }
  .auth-art-img {
    width: 100%; max-height: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
    mask-image: linear-gradient(to bottom, #000 78%, transparent);
    -webkit-mask-composite: initial; mask-composite: initial;
    animation: art-in .8s ease-out both;
  }
  .floaty { display: none; }
  .auth-panel { justify-content: flex-start; padding: 0 1rem 2rem; margin-top: -1.5rem; }
  .auth-card { margin-top: 70px; }
}

@media (max-width: 700px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: flex; justify-content: space-between; gap: 1rem; text-align: right; padding: .3rem 1rem; border: 0; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: left; flex: none; padding-top: .15rem; }
  .table td.cell-title { font-size: 1.05rem; text-align: left; justify-content: flex-start; }
  .table td.cell-title::before, .table td.cell-actions::before { display: none; }
  .table td.cell-actions { justify-content: flex-end; flex-wrap: wrap; }

  .cal { gap: .25rem; }
  .cal-cell { min-height: 54px; align-items: center; padding: .3rem .1rem; border-radius: 12px; }
  .cal-ev, .cal-more { display: none; }
  .cal-dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
  .cal-cell.has { background: var(--soft-sage); }
  .cal-dow { font-size: .62rem; letter-spacing: .02em; }
  .agenda-item { grid-template-columns: 64px 1fr; }
  .agenda-item small { grid-column: 2; }

  .section-row { grid-template-columns: auto minmax(0, 1fr); }
  .sr-badges, .sr-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .field-row { grid-template-columns: 1fr; }
  .row.icon-title { grid-template-columns: 96px 1fr; }
  .modal-body { padding: 1.1rem 1.1rem 1.3rem; }
  .modal-head { padding-left: 1.1rem; }
  .auth-card { padding: 82px 1.25rem 1.75rem; }
  .detail-title { font-size: 1.7rem; }
  .month-nav { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================ Inscriptions & clients ============================ */
.signup-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.sub-block { display: flex; flex-direction: column; gap: .4rem; }
.sub-block h5 { margin: .35rem 0 0; font: 800 .72rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.guest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.guest-list li { display: flex; align-items: center; gap: .5rem; padding: .35rem .4rem .35rem .95rem; border-radius: 16px; background: var(--surface); }
.g-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .8rem; }
.g-phone { font-weight: 700; text-decoration: none; white-space: nowrap; }
.g-phone:hover { text-decoration: underline; }


/* ============================ Réglages : bandeau, maintenance ============================ */

.banner { padding: .7rem 1.25rem; text-align: center; font-weight: 700; background: var(--soft-sage); border-bottom: 1px solid var(--line); }
.banner-warn { background: #F8E7BE; color: #6F4C00; }
.banner-ok { background: #DDEEDD; color: #1E5A35; }
.maintenance { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; padding: 2rem; text-align: center; }
.maintenance h1 { font-size: 3rem; }
.auth-logo.static { position: static; transform: none; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-actions.center { justify-content: center; }
.form-actions.spread { justify-content: space-between; align-items: center; }
.page-doc { padding: 1.5rem 1.75rem; max-width: 820px; }

/* ============================ Stock ============================ */

.stock-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.stock-card { display: flex; flex-direction: column; overflow: hidden; }
.stock-card .card-media { aspect-ratio: 4 / 3; }
.stock-card.archived { opacity: .6; }
.stock-card.low { border-color: color-mix(in srgb, #D9A22B 65%, var(--line)); }
.stock-card.empty-stock { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.media-badge { position: absolute; top: .6rem; right: .6rem; }
.media-badge.left { right: auto; left: .6rem; }
.stock-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.stock-card .card-title { font-size: 1.25rem; }
.qty-row { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.qty { display: flex; align-items: baseline; gap: .4rem; }
.qty-num { font: 700 2.3rem/1 var(--font-heading); color: var(--primary); }
.qty small { color: var(--muted); }
.price { font-weight: 800; color: var(--wood); }
.quick-row { display: flex; gap: .35rem; }
.qbtn {
  flex: 1; min-height: 46px; border: 0; border-radius: var(--r-ctl);
  font: 800 1.05rem var(--font-body); cursor: pointer; touch-action: manipulation; user-select: none;
  transition: transform .08s, filter .15s;
}
.qbtn:hover { filter: brightness(1.06); }
.qbtn:active { transform: scale(.93); }
.qbtn.plus { background: var(--primary); color: var(--on-primary); }
.qbtn.minus { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: color-mix(in srgb, var(--danger) 85%, black); }
.qbtn.more { background: var(--soft-sage); color: var(--primary); flex: 0 0 46px; }
.stock-tools { display: flex; align-items: center; justify-content: space-between; margin-top: .1rem; }
.tools-right { display: flex; }
.link-btn.small { font-size: .85rem; }
.filter-chip.warn.active { background: #C98A1B; border-color: #C98A1B; color: #fff; }
.pos { color: #1E6B3F; }
.neg { color: var(--danger); }
.thumb { width: 44px; height: 44px; border-radius: 12px; background: var(--soft-accent); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 1.4rem; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Sortie pour une entreprise */
.withdraw-list { display: flex; flex-direction: column; gap: .3rem; max-height: 320px; overflow: auto; padding: .3rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--field-bg); }
.withdraw-row { display: flex; align-items: center; gap: .7rem; padding: .4rem .5rem; border-radius: var(--r-ctl); }
.withdraw-row.picked { background: var(--soft-sage); }
.stepper { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.stepper input { width: 64px; text-align: center; padding: .3rem .2rem; min-height: 40px; }
.stepper .icon-btn { width: 40px; height: 40px; font-size: 1.4rem; font-weight: 800; background: var(--soft-sage); }
.withdraw-summary { font-weight: 700; }

/* ============================ Contrats (entreprises) ============================ */

.company-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .75rem; transition: transform .18s, box-shadow .18s; }
.company-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.company-top { display: flex; gap: .85rem; align-items: center; }
.company-top.big { margin-bottom: .5rem; }
.company-title { min-width: 0; }
.company-logo { width: 56px; height: 56px; border-radius: var(--r-ctl); background: var(--soft-accent); color: var(--primary); display: grid; place-items: center; font: 700 1.3rem var(--font-heading); overflow: hidden; flex: none; }
.company-logo.lg { width: 84px; height: 84px; font-size: 1.9rem; }
.company-logo img { width: 100%; height: 100%; object-fit: cover; }
.chip-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.company-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line); position: relative; z-index: 2; }
.facts a.above { position: relative; z-index: 2; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.history-list li { background: var(--surface); border-radius: var(--r-ctl); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .3rem; }
.hl-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.hl-lines { display: flex; flex-wrap: wrap; gap: .3rem; }

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

.tab-strip { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1.25rem; scrollbar-width: thin; }
.tab-link { flex: none; padding: .5rem 1rem; border-radius: var(--r-pill); text-decoration: none; font-weight: 700; color: var(--primary); background: var(--soft-sage); white-space: nowrap; }
.tab-link:hover { filter: brightness(.97); }
.tab-link.active { background: var(--primary); color: var(--on-primary); }
.settings-body { display: flex; flex-direction: column; gap: 1.25rem; }
.settings-body > .card.panel { margin-bottom: 0; }
.label-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.panel-tools { display: flex; justify-content: flex-end; margin-top: -3.2rem; margin-bottom: 1rem; }
.code-area { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.block-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.block-row { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field-bg); display: flex; flex-direction: column; gap: .6rem; }
.block-row.off { opacity: .6; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.links-editor { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; width: 100%; }
.link-row { width: 100%; display: grid; grid-template-columns: 70px 1fr 1.6fr auto; gap: .5rem; align-items: center; }
.link-row.profile-row { grid-template-columns: 1fr 1fr auto auto; }
.perm-list { display: flex; flex-direction: column; gap: .6rem; margin: .5rem 0 1rem; }
.perm-row { display: grid; grid-template-columns: 1fr minmax(220px, 290px); gap: 1rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--field-bg); }
.panel-plain { display: flex; flex-direction: column; }
.tags-editor { display: flex; flex-direction: column; gap: .4rem; width: 100%; }
.tone-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .45rem; }
.tone-pick { display: flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; }
.tone-pick select { min-height: 34px; padding: .15rem .5rem; width: auto; }
.fr-checks { display: flex; flex-direction: column; gap: .05rem; }
.fr-help { grid-column: 1 / -1; }
.card-soft { padding: .8rem; border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); }
.sys dt { white-space: nowrap; }
.tab-strip::-webkit-scrollbar { height: 6px; }

@media (max-width: 700px) {
  .link-row, .link-row.profile-row { grid-template-columns: 1fr; }
  .perm-row { grid-template-columns: 1fr; }
  .panel-tools { margin-top: 0; justify-content: flex-start; }
  .stock-grid { grid-template-columns: 1fr; }
  .qbtn { min-height: 52px; }
  .page-doc { padding: 1.1rem; }
}

.stock-grid { align-items: start; }
.maintenance .muted { margin-top: -.4rem; }

@media (max-width: 700px) { .stock-card .card-media { aspect-ratio: 16 / 7; } }
