/* =========================================================================
   PHOTOBOOK — design system « Graphite »
   Sombre mais pas noir : couches de gris anthracite, noir et blanc uniquement,
   typographie Instrument Sans. Mobile d'abord : barre d'onglets, feuilles, bouton +.
   ========================================================================= */
@view-transition { navigation: auto; }
:root {
  --bg: #141518;
  --bg-2: #18191d;
  --surface: #1c1d21;
  --surface-2: #222328;
  --surface-3: #2a2b31;
  --rail: #1a1b1f;
  --line: #2a2b30;
  --line-2: #34363c;
  --text: #ececef;
  --text-2: #a3a4ab;
  --muted: #6e7078;
  --accent: #ffffff;
  --accent-ink: #111214;
  --violet: #ffffff; --mint: #4fd1a5; --amber: #f5b454; --coral: #f07a7a; --sky: #6cb4f5;
  --ok: #4fd1a5; --warn: #f5b454; --danger: #f07a7a; --info: #6cb4f5;
  --r-sm: 9px; --r: 13px; --r-lg: 18px; --r-xl: 24px;
  --sh: 0 1px 0 rgba(255,255,255,.035) inset, 0 24px 60px -32px rgba(0,0,0,.75);
  --ease: cubic-bezier(.22,1,.36,1);
  --ease-2: cubic-bezier(.65,0,.35,1);
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar: 256px;
  --sidebar-mini: 76px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.55; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; font-stretch: 100%; }
::selection { background: #fff; color: #000; }
a { color: inherit; text-decoration: none; }
img, video, svg { max-width: 100%; }
img, video { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.025em; line-height: 1.15; font-weight: 600; }
h1 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.035em; }
h2 { font-size: 19px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
p { margin: 0 0 .8em; color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.ic { display: inline-block; flex: none; vertical-align: middle; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); } .small { font-size: 13px; } .xs { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.only-m { display: none !important; }
.glow { display: none; }

/* ------------------------------------------------------------------ coque desktop */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .45s var(--ease); }
html.nav-mini .app { grid-template-columns: var(--sidebar-mini) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 18px 14px; background: var(--rail); border-right: 1px solid var(--line); overflow: hidden auto; scrollbar-width: none; z-index: 40; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: #fff; color: #111; display: grid; place-items: center; flex: none; }
.sb-toggle { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); display: grid; place-items: center; transition: .25s; flex: none; }
.sb-toggle:hover { color: var(--text); background: var(--surface-2); }
html.nav-mini .sb-toggle .ic { transform: scaleX(-1); }
.profile-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: background .25s; }
.profile-card:hover { background: var(--surface-2); }
.profile-card .name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.profile-card .role { font-size: 12px; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: linear-gradient(140deg, #f2f2f4, #9fa0a8); color: #16171a; flex: none; overflow: hidden; }
.avatar.sq { border-radius: 11px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; } .avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; color: #5d5f66; padding: 14px 10px 6px; white-space: nowrap; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background .2s, color .2s; }
.nav a .ic { color: #7c7e86; transition: color .2s; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a:hover .ic { color: var(--text); }
.nav a.active { background: var(--surface-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.nav a.active .ic { color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #fff; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.storage { padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: #fff; transition: width 1.2s var(--ease); }
.ext-ic { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
html.nav-mini .sidebar { padding: 18px 12px; align-items: center; }
html.nav-mini .sb-head { flex-direction: column; gap: 12px; }
html.nav-mini .brand .brand-txt, html.nav-mini .nav a span, html.nav-mini .nav-label, html.nav-mini .profile-card > div:last-child, html.nav-mini .storage, html.nav-mini .ext-ic { display: none; }
html.nav-mini .nav a { justify-content: center; padding: 11px; width: 48px; }
html.nav-mini .nav a .count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; background: var(--coral); color: #fff; }
html.nav-mini .nav a.active::before { left: -12px; }
html.nav-mini .profile-card { padding: 4px; background: none; border: 0; }
html.nav-mini .nav { align-items: center; }
html.nav-mini .nav-sep { display: block; width: 28px; height: 1px; background: var(--line); margin: 10px 0; }
.nav-sep { display: none; }

.main { min-width: 0; padding: 0 clamp(16px, 3vw, 40px) 64px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 16px 0 12px; background: linear-gradient(var(--bg) 70%, rgba(20,21,24,0)); }
.topbar .title-m { display: none; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); outline: none; font-size: 13.5px; transition: border-color .2s, background .2s; }
.search input:focus { border-color: var(--line-2); background: var(--surface-2); }
.search > .ic { position: absolute; left: 14px; top: 12px; color: var(--muted); pointer-events: none; }
.search-results { position: absolute; top: 50px; left: 0; right: 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; box-shadow: var(--sh); display: none; max-height: 60vh; overflow: auto; z-index: 50; }
.search-results.open { display: block; animation: pop .25s var(--ease); }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; font-size: 13.5px; }
.search-results a:hover { background: var(--surface-3); }
.search-results .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 8px 10px 4px; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); transition: .2s; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .badge-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg); }
.menu-toggle { display: none; }

/* ------------------------------------------------------------------ en-têtes */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 24px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 12px; }
.page-head p { margin: 6px 0 0; max-width: 640px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.crumbs a:hover { color: var(--text); }

/* ------------------------------------------------------------------ boutons */
.btn { --b-bg: var(--surface-2); --b-fg: var(--text); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--b-bg); color: var(--b-fg); font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; isolation: isolate; user-select: none; transition: transform .25s var(--ease), background .2s, border-color .2s, box-shadow .3s, opacity .2s; }
.btn:hover { --b-bg: var(--surface-3); border-color: #44464d; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .input:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn.primary { --b-bg: #ffffff; --b-fg: #111214; border-color: #fff; }
.btn.primary:hover { --b-bg: #e9e9ec; border-color: #e9e9ec; box-shadow: 0 10px 28px -14px rgba(255,255,255,.5); }
.btn.ghost { --b-bg: transparent; border-color: transparent; }
.btn.ghost:hover { --b-bg: var(--surface-2); }
.btn.danger { --b-bg: rgba(240,122,122,.1); --b-fg: #ffb5b5; border-color: rgba(240,122,122,.28); }
.btn.danger:hover { --b-bg: rgba(240,122,122,.18); }
.btn.ok { --b-bg: rgba(79,209,165,.12); --b-fg: #a7f0d4; border-color: rgba(79,209,165,.3); }
.btn.accent { --b-bg: #fff; --b-fg: #111214; border-color: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn.icon { width: 40px; padding: 0; } .btn.sm.icon { width: 34px; } .btn.xs.icon { width: 28px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn.loading { pointer-events: none; color: transparent !important; }
.btn.loading .ic { opacity: 0; }
.btn.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--b-fg); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.25); animation: ripple .6s var(--ease); pointer-events: none; z-index: -1; }
.btn.primary .ripple { background: rgba(0,0,0,.12); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ------------------------------------------------------------------ cartes */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; transition: border-color .25s, transform .4s var(--ease), box-shadow .4s, background .25s; }
.card.hover:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.card.flat { padding: 0; overflow: hidden; }
.card.raised { background: var(--surface-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.card-head h3 .ic { color: var(--text-2); }
.spot { --x: 50%; --y: 50%; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(360px circle at var(--x) var(--y), rgba(255,255,255,.05), transparent 45%); }
.spot:hover::before { opacity: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.gap-s { gap: 6px; }

.stat { padding: 18px; overflow: hidden; }
.stat .k { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat .k .ic-wrap { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: #fff; }
.stat .v { font-size: 28px; font-weight: 600; letter-spacing: -.035em; margin-top: 10px; line-height: 1.1; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 4px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.trend.up { color: var(--mint); background: rgba(79,209,165,.12); } .trend.down { color: var(--coral); background: rgba(240,122,122,.12); } .trend.flat { color: var(--text-2); background: var(--surface-3); }
.spark { width: 100%; height: 44px; margin-top: 10px; overflow: visible; display: block; }

/* ------------------------------------------------------------------ badges & puces */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { color: var(--mint); background: rgba(79,209,165,.1); border-color: rgba(79,209,165,.22); }
.badge.warn { color: var(--amber); background: rgba(245,180,84,.1); border-color: rgba(245,180,84,.22); }
.badge.danger { color: var(--coral); background: rgba(240,122,122,.1); border-color: rgba(240,122,122,.22); }
.badge.info { color: var(--sky); background: rgba(108,180,245,.1); border-color: rgba(108,180,245,.22); }
.badge.violet { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.badge.white { background: #fff; color: #111; border-color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2); user-select: none; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on, .chip.on:hover { background: #fff; color: #111; border-color: #fff; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------ formulaires */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line-2); outline: none; font-size: 14px; transition: border-color .2s, box-shadow .25s, background .2s; }
.textarea { min-height: 108px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: #5a5c64; box-shadow: 0 0 0 4px rgba(255,255,255,.06); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: #5f6168; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23a3a4ab' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input[type=color] { padding: 4px; height: 44px; cursor: pointer; }
input[type=file].input { padding: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12.5px; color: #111; background: #fff; border: 0; border-radius: 8px; padding: 8px 14px; margin-right: 12px; cursor: pointer; }
.input-group { display: flex; } .input-group .input { border-radius: 11px 0 0 11px; } .input-group .btn { border-radius: 0 11px 11px 0; height: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .t { font-weight: 600; font-size: 13.5px; } .switch .s { font-size: 12px; color: var(--muted); }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .3s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #8b8d95; transition: transform .35s var(--ease), background .3s; }
.switch input:checked { background: #fff; border-color: #fff; } .switch input:checked::after { transform: translateX(18px); background: #111214; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--bg-2); display: grid; place-items: center; cursor: pointer; transition: .2s; flex: none; }
.check input:checked { background: #fff; border-color: #fff; }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #111; border-bottom: 2px solid #111; transform: rotate(-45deg) translate(1px,-1px); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button, .seg a, .seg label { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; cursor: pointer; }
.seg input { display: none; }
.seg button:hover, .seg a:hover, .seg label:hover { color: var(--text); }
.seg .on, .seg .on:hover, .seg label:has(input:checked) { background: var(--surface-3); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 11px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); white-space: nowrap; transition: color .2s; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); }
.tabs a.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: #fff; animation: grow .4s var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .2s; }
.t tbody tr:hover { background: var(--surface-2); }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }

.list-item { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); flex: none; color: var(--text-2); overflow: hidden; }
.list-item .ico img { width: 100%; height: 100%; object-fit: cover; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ic-big { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); margin: 0 auto 14px; color: #fff; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

.pgrid-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px 18px; }
.pcard { display: block; }
.pcard .media { position: relative; aspect-ratio: 16/10; border-radius: 16px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.pcard .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.pcard:hover .media img { transform: scale(1.05); }
.pcard .ph-empty { height: 100%; display: grid; place-items: center; color: #4b4d54; }
.pcard .tl { position: absolute; top: 11px; left: 11px; font-size: 11px; font-weight: 600; color: #e6e6e9; padding: 4px 10px; border-radius: 99px; background: rgba(20,21,24,.7); backdrop-filter: blur(8px); }
.pcard .tr { position: absolute; top: 12px; right: 12px; display: flex; gap: 3px; padding: 7px; border-radius: 99px; background: rgba(20,21,24,.6); backdrop-filter: blur(8px); }
.pcard .tr i { width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.pcard .go { position: absolute; right: 11px; bottom: 11px; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; opacity: 0; transform: translateY(8px) scale(.85); transition: .4s var(--ease); }
.pcard:hover .go { opacity: 1; transform: none; }
.pcard .prog { position: absolute; left: 12px; right: 58px; bottom: 16px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; }
.pcard .prog i { display: block; height: 100%; background: #fff; border-radius: inherit; }
.pcard .cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 3px 3px; }
.pcard .ttl { font-size: 14px; font-weight: 600; }
.pcard .pill { flex: none; font-size: 11px; font-weight: 600; color: var(--text-2); padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.pcard .sub { display: flex; justify-content: space-between; gap: 10px; margin: 0 3px; font-size: 12px; color: var(--muted); }
.pcard .nums { display: flex; gap: 10px; flex: none; }
.pcard .nums span { display: inline-flex; align-items: center; gap: 4px; }
.progress-mini { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 12px; overflow: hidden; }
.progress-mini i { display: block; height: 100%; background: #fff; border-radius: inherit; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kcol { background: var(--rail); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; min-height: 220px; transition: background .25s, border-color .25s; }
.kcol.drag-over { background: var(--surface); border-color: #4a4c54; border-style: dashed; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.kadd { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.kcard { display: block; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 15px; margin-bottom: 10px; cursor: grab; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; }
.kcard:hover { border-color: #45474e; transform: translateY(-2px); box-shadow: 0 18px 36px -22px rgba(0,0,0,.8); }
.kcard.dragging { opacity: .85; transform: rotate(2deg) scale(1.02); }
.kc-top { display: flex; justify-content: space-between; gap: 10px; }
.kc-top h4 { font-size: 14px; }
.kc-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.kc-more { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text-2); }
.kc-prog { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; font-size: 12.5px; color: var(--text-2); }
.kc-prog b { color: var(--text); }
.kc-bar { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.kc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--amber); }
.kc-bar.low i { background: var(--coral); } .kc-bar.ok i { background: var(--mint); }
.kc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 8px; }
.kc-date { white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 5px 11px; border-radius: 99px; background: var(--surface-3); }
.kc-date.late { color: #ffbcbc; background: rgba(240,122,122,.14); }
.kc-counts { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.kc-counts > span { display: inline-flex; align-items: center; gap: 4px; }

.task { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 8px; transition: .3s var(--ease); }
.task:hover { border-color: var(--line-2); }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.task .tt { flex: 1; font-weight: 500; font-size: 13.5px; }

.drop { position: relative; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 34px 20px; text-align: center; background: var(--bg-2); transition: .3s var(--ease); cursor: pointer; }
.drop:hover, .drop.over { border-color: #fff; background: var(--surface); }
.drop .ic-big { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: #fff; color: #111; transition: transform .4s var(--ease); }
.drop.over .ic-big { transform: translateY(-5px) scale(1.06); }
.queue { margin-top: 14px; display: grid; gap: 8px; }
.qitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; animation: slideUp .35s var(--ease); }
.qitem .bar { flex: 1; }
.qitem.ok .bar i { background: var(--mint); } .qitem.err .bar i { background: var(--coral); }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pthumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.pthumb:hover img { transform: scale(1.06); }
.pthumb .tags { position: absolute; top: 7px; left: 7px; display: flex; gap: 4px; }
.pthumb .tags span { min-width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); color: #fff; font-size: 11px; font-weight: 700; padding: 0 6px; }
.pthumb .tags span.on { background: #fff; color: #e0245e; }
.pthumb .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); opacity: 0; transition: .3s; }
.pthumb:hover .nm { opacity: 1; }
.pthumb .pick { position: absolute; top: 7px; right: 7px; }
.pthumb.sel { outline: 2px solid #fff; outline-offset: -2px; }
.pthumb .vid { position: absolute; inset: 0; display: grid; place-items: center; }
.pthumb .vid span { width: 42px; height: 42px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; }

/* ------------------------------------------------------------------ modales, feuilles, tiroirs */
.modal-bg { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(8,8,10,.6); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 24px; box-shadow: 0 40px 100px -24px rgba(0,0,0,.85); transform: translateY(20px) scale(.97); transition: transform .45s var(--ease); }
.modal.lg { max-width: 820px; }
.modal-bg.open .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 210; background: var(--surface); border-left: 1px solid var(--line-2); transform: translateX(105%); transition: transform .5s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; box-shadow: -40px 0 100px rgba(0,0,0,.5); }
.drawer-head { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 14px 20px; }
.drawer-foot { padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); }
.scrim { position: fixed; inset: 0; z-index: 190; background: rgba(8,8,10,.55); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }

.notif { display: flex; gap: 12px; padding: 12px; border-radius: 13px; transition: background .2s; position: relative; }
.notif:hover { background: var(--surface-2); }
.notif.unread::after { content: ""; position: absolute; top: 18px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }
.notif .ico { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; flex: none; }
.notif b { font-size: 13.5px; display: block; font-weight: 600; } .notif p { margin: 2px 0 0; font-size: 12.5px; }

.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 11px; min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 14px; background: #f4f4f6; color: #111; font-weight: 600; font-size: 13.5px; box-shadow: 0 20px 50px -12px rgba(0,0,0,.6); animation: toastIn .5s var(--ease); }
.toast.err { background: #3a1d20; color: #ffd0d0; border: 1px solid rgba(240,122,122,.35); }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(16px) scale(.94); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

[data-anim] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 50ms); }
[data-anim].in { opacity: 1; transform: none; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes float { 50% { transform: translateY(-6px); } }
.page-enter { animation: pageIn .55s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
::view-transition-old(root) { animation: .25s var(--ease) both vtOut; }
::view-transition-new(root) { animation: .4s var(--ease) both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
img.lazy { opacity: 0; transition: opacity .6s var(--ease); }
img.lazy.loaded { opacity: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(79,209,165,.6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(79,209,165,0); } 100% { box-shadow: 0 0 0 0 rgba(79,209,165,0); } }
.avail { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 6px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ tableau de bord */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--line); background: linear-gradient(120deg, #22232a 0%, #1b1c21 55%, #202126 100%); padding: 30px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; min-height: 280px; margin-bottom: 16px; }
.hero::before { content: ""; position: absolute; top: -260px; right: -120px; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.07), transparent 62%); pointer-events: none; }
.hero > * { position: relative; }
.hero h1 { font-size: clamp(22px, 2.1vw, 30px); line-height: 1.15; letter-spacing: -.05em; font-weight: 600; }
.hero h1 span { color: #8d8e97; font-weight: 500; }
.hero .lead { font-size: 15px; color: var(--text-2); margin: 14px 0 20px; max-width: 520px; }
.hero .lead b { color: var(--text); font-weight: 600; }
.hero-kpis { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.07); }
.hero-kpis b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.hero-kpis span { font-size: 12px; color: var(--muted); }
.hero-mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: center; transform: rotate(-5deg) translateY(-6px); margin: -10px -10px -40px 0; }
.hero-mosaic div { border-radius: 14px; overflow: hidden; background: var(--surface-3); aspect-ratio: 3/4; box-shadow: 0 18px 40px -20px rgba(0,0,0,.85); animation: drift 9s ease-in-out infinite alternate; }
.hero-mosaic div:nth-child(3n+2) { animation-delay: -3s; margin-top: 26px; }
.hero-mosaic div:nth-child(3n) { animation-delay: -6s; }
.hero-mosaic img { width: 100%; height: 100%; object-fit: cover; }
@keyframes drift { to { translate: 0 -12px; } }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.chart-box { position: relative; }
.chart-box svg { display: block; width: 100%; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; transform: translate(-50%, -120%); background: #f4f4f6; color: #111; font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .15s; z-index: 5; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.legend-list { display: grid; gap: 10px; font-size: 13px; }
.legend-list div { display: flex; align-items: center; gap: 10px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-list b { margin-left: auto; font-weight: 600; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; }
.recent-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.recent-strip::-webkit-scrollbar { display: none; }
.timeline .tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.timeline .tl-item::before { content: ""; position: absolute; left: 11px; top: 28px; bottom: 2px; width: 1px; background: var(--line); }
.timeline .tl-item:last-child::before { display: none; }

/* ------------------------------------------------------------------ authentification */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; border-right: 1px solid var(--line); background: radial-gradient(900px 520px at 0% 0%, rgba(255,255,255,0.08), transparent 60%), linear-gradient(160deg, #1d1e23, #141518); }
.auth-art .tiles { position: absolute; inset: -12%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; transform: rotate(-8deg); opacity: .55; }
.auth-art .tiles div { border-radius: 18px; background: linear-gradient(160deg, #2a2b31, #1c1d21); border: 1px solid var(--line); aspect-ratio: 3/4; animation: drift 10s ease-in-out infinite alternate; }
.auth-art .tiles div:nth-child(odd) { animation-delay: -4s; }
.auth-art > * { position: relative; }
.auth-form { display: grid; place-items: center; padding: 36px 22px; }
.auth-form .box { width: 100%; max-width: 390px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }
.alert.err { background: rgba(240,122,122,.1); border: 1px solid rgba(240,122,122,.28); color: #ffc9c9; }
.alert.ok { background: rgba(79,209,165,.1); border: 1px solid rgba(79,209,165,.28); color: #b8f2dc; }
.alert.warn { background: rgba(245,180,84,.1); border: 1px solid rgba(245,180,84,.28); color: #ffdcab; }
.alert.info { background: rgba(255,255,255,.05); border: 1px solid var(--line-2); color: var(--text); }

.steps { counter-reset: s; display: grid; gap: 10px; }
.steps > div { counter-increment: s; position: relative; padding: 13px 13px 13px 52px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--line); }
.steps > div::before { content: counter(s); position: absolute; left: 13px; top: 13px; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #111; font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.lc-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 26px; border: 1px solid var(--line-2); background: radial-gradient(600px 300px at 100% 0%, rgba(255,255,255,0.08), transparent 60%), var(--surface); }
.lc-hero .rays { display: none; }

/* LightCraft embarqué */
.lc-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; height: calc(100vh - 150px); min-height: 560px; }
.lc-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.lc-photos { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start; padding-right: 2px; }
.lc-photos button { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 9px; overflow: hidden; background: var(--surface-2); outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .2s; }
.lc-photos button img { width: 100%; height: 100%; object-fit: cover; }
.lc-photos button.sent { outline-color: var(--violet); }
.lc-photos button.saved::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--surface); }
.lc-photos button .sel-h { position: absolute; left: 5px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #e0245e; display: grid; place-items: center; }
.lc-stage { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #1c1c1c; }
.lc-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.lc-status { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-size: 14px; pointer-events: none; text-align: center; padding: 20px; }
.lc-log { font-size: 12px; max-height: 120px; overflow: auto; display: grid; gap: 4px; }

/* éditeur visuel (e-mails) */
.rte { border: 1px solid var(--line-2); border-radius: 13px; background: var(--bg-2); overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.rte-bar button { height: 32px; min-width: 32px; padding: 0 9px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rte-bar button:hover { background: var(--surface-3); color: var(--text); }
.rte-bar .sep { width: 1px; background: var(--line); margin: 4px; }
.rte-body { min-height: 240px; padding: 16px 18px; outline: none; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.rte-body p, .rte-body div { color: var(--text); margin: 0 0 .9em; }
.rte-body a { color: var(--sky); text-decoration: underline; }
.rte-body h2 { font-size: 20px; margin: 0 0 .6em; }
.var { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; margin: 0 1px; border-radius: 99px; background: rgba(255,255,255,.1); color: #fff; font-size: 12.5px; font-weight: 600; border: 1px solid rgba(255,255,255,0.18); white-space: nowrap; cursor: default; vertical-align: baseline; }
.var.btnvar { background: #fff; color: #111; border-color: #fff; padding: 5px 16px; }
.var.blockvar { background: var(--surface-3); color: var(--text-2); border-color: var(--line-2); }
.var-list { display: flex; flex-wrap: wrap; gap: 6px; }
.var-list button { height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; }
.var-list button:hover { color: var(--text); border-color: var(--violet); }
.tpl-list { display: grid; gap: 2px; }
.tpl-list a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.tpl-list a:hover { background: var(--surface-2); color: var(--text); }
.tpl-list a.on { background: var(--surface-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.preview-frame { width: 100%; height: 600px; border: 0; border-radius: 13px; background: #f4f4f5; display: block; }

/* ------------------------------------------------------------------ mobile : une vraie app */
.tabbar, .fab, .sheet-nav { display: none; }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .split { grid-template-columns: 1fr; } .hero { grid-template-columns: 1fr; } .hero-mosaic { display: none; } .lc-shell { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .only-m { display: revert !important; }
  .avatar.only-m, .icon-btn.only-m { display: grid !important; }
  .chip-scroll { flex-wrap: nowrap !important; overflow-x: auto; margin-left: -16px !important; margin-right: -16px !important; padding: 0 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chip-scroll::-webkit-scrollbar { display: none; }
  .chip-scroll > * { flex: none; }
  .hide-m { display: none !important; }
  .app, html.nav-mini .app { display: block; }
  .sidebar { display: none; }
  .main { padding: 0 16px calc(var(--tabbar) + 36px + var(--safe-b)); }
  .topbar { margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: rgba(20,21,24,.84); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid transparent; transition: border-color .3s; gap: 10px; }
  .topbar.scrolled { border-bottom-color: var(--line); }
  .topbar .title-m { display: block; flex: 1; min-width: 0; font-weight: 700; font-size: 16px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity .25s; }
  .topbar.scrolled .title-m { opacity: 1; }
  .topbar .search { display: none; }
  .topbar .search.open { display: block; position: absolute; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top, 0px)); max-width: none; z-index: 5; }
  .topbar .spacer { display: none; }
  .icon-btn { width: 40px; height: 40px; border-radius: 50%; }
  .page-head { margin: 4px 0 18px; align-items: flex-start; }
  .page-head h1 { font-size: 30px; letter-spacing: -.04em; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .page-head .actions .search { display: none; }
  .kanban { grid-template-columns: repeat(4, 84vw); scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 10px; scroll-padding: 16px; }
  .kcol { scroll-snap-align: start; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; height: calc(var(--tabbar) + var(--safe-b)); padding: 6px 6px var(--safe-b); background: rgba(26,27,31,.9); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 12px; transition: color .2s; position: relative; }
  .tabbar a.active, .tabbar button.active { color: #fff; }
  .tabbar .tb-badge { position: absolute; top: 2px; left: 54%; min-width: 16px; height: 16px; border-radius: 99px; background: var(--coral); color: #fff; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
  .fab { display: grid; position: fixed; right: 16px; bottom: calc(var(--tabbar) + 16px + var(--safe-b)); z-index: 121; width: 56px; height: 56px; border-radius: 18px; place-items: center; background: #fff; color: #111; border: 0; box-shadow: 0 16px 36px -10px rgba(0,0,0,.7); transition: transform .3s var(--ease); }
  .fab:active { transform: scale(.92); }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal, .modal.lg { max-width: none; border-radius: 24px 24px 0 0; padding: 10px 18px calc(20px + var(--safe-b)); max-height: 92vh; transform: translateY(100%); transition: transform .45s var(--ease); }
  .modal-bg.open .modal { transform: none; }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 2px auto 14px; }
  .drawer { top: auto; left: 0; width: 100%; height: 86vh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 24px 24px 0 0; transform: translateY(105%); }
  .sheet-nav { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--surface); border-top: 1px solid var(--line-2); border-radius: 24px 24px 0 0; padding: 10px 14px calc(14px + var(--safe-b)); transform: translateY(105%); transition: transform .45s var(--ease); max-height: 86vh; overflow: auto; }
  .sheet-nav.open { transform: none; box-shadow: 0 -30px 80px rgba(0,0,0,.6); }
  .sheet-nav::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 2px auto 14px; }
  .sheet-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin: 4px 4px 10px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
  .sheet-grid a, .sheet-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text); text-align: center; }
  .sheet-grid a.active { background: #fff; color: #111; border-color: #fff; }
  .toasts { left: 12px; right: 12px; bottom: calc(var(--tabbar) + 14px + var(--safe-b)); }
  .toast { max-width: none; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .donut-wrap { grid-template-columns: 120px 1fr; }
  .lightcraft-desktop-only { display: none !important; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .g2, .g3, .form-grid { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 16px; border-radius: 16px; }
  .stat { padding: 14px; } .stat .v { font-size: 22px; } .stat .k { font-size: 11.5px; } .stat .k .ic-wrap { width: 30px; height: 30px; }
  .pgrid { grid-template-columns: repeat(3, 1fr); gap: 4px; } .pthumb { border-radius: 8px; }
  .pgrid-cards { grid-template-columns: 1fr; gap: 18px; }
  .t th, .t td { padding: 12px 10px; }
  .hero { padding: 22px 18px; border-radius: 20px; min-height: 0; }
  .hero h1 { font-size: 22px; }
  .hero-kpis { gap: 16px 24px; } .hero-kpis b { font-size: 20px; }
  .btn { height: 44px; } .btn.sm { height: 38px; } .btn.xs { height: 32px; }
  .input, .select { min-height: 48px; font-size: 16px; } .textarea { font-size: 16px; }
  .tabs { margin: 0 -16px 18px; padding: 0 12px; }
  .list-item { padding: 14px 0; }
  .split, .stack, .grid { gap: 12px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .modal-foot .btn { flex: 1; }
}
@media (hover: none) { .card.hover:hover, .kcard:hover { transform: none; } .pcard .go { opacity: 1; transform: none; } .pthumb .nm { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } [data-anim] { opacity: 1; transform: none; } }
@media print { .sidebar, .topbar, .tabbar, .fab, .no-print, .toasts { display: none !important; } body { background: #fff; color: #000; } .app { display: block; } }

/* Objet d'e-mail éditable (étiquettes en ligne) */
.rte-line { height: auto; min-height: 46px; padding: 10px 14px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; cursor: text; outline: none; }
.rte-line:focus { border-color: var(--line-3, rgba(255,255,255,.22)); }
.rte-line .var { font-size: 12px; }

/* Garde-fous anti-débordement mobile : les enfants de grilles peuvent rétrécir */
html { overflow-x: clip; }
.grid > *, .split > *, .stack > *, .row > .grow, .card, .list-item { min-width: 0; }
.list-item > div { min-width: 0; }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: #fff; border-radius: inherit; transition: width .3s var(--ease); }

/* =========================================================================
   v1.3 — expérience revue (noir et blanc)
   ========================================================================= */
/* Boutons : une couleur unie, aucune ombre ni dégradé ; légère montée au survol */
.btn { box-shadow: none !important; background-image: none !important; transition: transform .28s var(--ease), background-color .2s, border-color .2s, color .2s, opacity .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn .ic { transition: transform .35s var(--ease); }
.btn:hover .ic { transform: scale(1.12); }
.btn.primary:hover { --b-bg: #e6e6e9; border-color: #e6e6e9; box-shadow: none; }
.btn.white { --b-bg: #fff; --b-fg: #111214; border-color: #fff; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 14.5px; border-radius: 12px; }
.row > .btn, .actions > .btn, .input-group > .btn { flex-shrink: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); }
h1, h2, h3, .kpi-v, .stat .v, .hero h1 { font-stretch: 94%; }
.hero h1, .team-hero h1 { letter-spacing: -.03em; }
.search .kbd-hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input { padding-right: 52px; }
.avatar.av-0, .avatar.av-1, .avatar.av-2, .avatar.av-3, .avatar.av-4, .avatar.av-5 { color: #16171a; }
.av-0 { background: linear-gradient(140deg, #ffffff, #b9bac1); } .av-1 { background: linear-gradient(140deg, #e4e5ea, #8e9098); } .av-2 { background: linear-gradient(140deg, #d2d3d9, #7a7c84); }
.av-3 { background: linear-gradient(140deg, #f2f2f4, #9fa0a8); } .av-4 { background: linear-gradient(140deg, #c7c8ce, #6b6d75); } .av-5 { background: linear-gradient(140deg, #ececef, #a8aab2); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; } .avatar.xs { width: 22px; height: 22px; font-size: 9px; } .avatar.lg { width: 56px; height: 56px; font-size: 18px; } .avatar.xl { width: 76px; height: 76px; font-size: 24px; }

/* En-tête de page */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 6px 0 20px; }
.phead h1 { display: flex; align-items: center; gap: 12px; }
.phead h1 .count-pill { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text-2); height: 26px; padding: 0 10px; border-radius: 99px; display: inline-grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-variant-numeric: tabular-nums; font-stretch: 100%; }
.phead .sub { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.phead .sub b { color: var(--text); font-weight: 600; }

/* Bandeau d'indicateurs (comme le tableau de bord) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: transform .4s var(--ease), border-color .25s, background .25s; }
a.kpi:hover { transform: translateY(-3px); border-color: var(--line-2); background: var(--surface-2); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi .kpi-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: #fff; flex: none; transition: transform .4s var(--ease); }
a.kpi:hover .kpi-ic { transform: rotate(-8deg) scale(1.08); }
.kpi .kpi-v { font-size: 30px; font-weight: 600; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .kpi-d { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.kpi.tone-coral .kpi-v { color: #ffb5b5; } .kpi.tone-amber .kpi-v { color: #fff; }
.kpi.tone-coral .kpi-ic { background: rgba(240,122,122,.14); color: var(--coral); }

/* Barre d'outils */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { max-width: 280px; flex: 1 1 220px; }
.toolbar .search input { height: 38px; padding-right: 14px; }
.toolbar .search > .ic { top: 50%; transform: translateY(-50%); }
.chip .n { font-size: 11.5px; opacity: .6; font-variant-numeric: tabular-nums; }
.chip.on .n { opacity: .55; }
.chip i { flex: none; }

/* Pagination des tableaux */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager .info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pager button { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 13px; display: inline-grid; place-items: center; transition: background .2s, color .2s, transform .25s var(--ease); font-variant-numeric: tabular-nums; }
.pager button:hover:not([disabled]) { color: #fff; background: var(--surface-3); transform: translateY(-1px); }
.pager button.on { background: #fff; color: #111214; border-color: #fff; }
.pager button[disabled] { opacity: .35; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 4px; }
tbody.paging tr { animation: fadeIn .3s var(--ease); }

/* Projets : cartes de kanban */
.kcol-head .kt { display: inline-flex; align-items: center; gap: 8px; }
.kcol-head .kt i { width: 8px; height: 8px; border-radius: 50%; background: var(--kc, var(--muted)); }
.kcol-head .kn { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kadd { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--muted); transition: .2s; }
.kadd:hover { background: var(--surface-2); color: var(--text); }
.kcard { overflow: hidden; }
.kcard::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pc, transparent); }
.kc-cover { margin: -16px -16px 14px; height: 96px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--surface-3); overflow: hidden; }
.kc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.kcard:hover .kc-cover img { transform: scale(1.06); }
.kc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kc-top h4 { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.kc-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.kc-prog { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 7px; font-size: 12px; color: var(--text-2); }
.kc-prog b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.kc-bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.kc-bar i { display: block; height: 100%; border-radius: inherit; background: #fff; }
.kc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; }
.kc-date { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 9px; border-radius: 99px; background: var(--surface-3); }
.kc-date.late { color: #ffb5b5; background: rgba(240,122,122,.14); }
.kc-date.soon { color: #111214; background: #fff; }
.kc-counts { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.kc-counts > span { display: inline-flex; align-items: center; gap: 4px; }

/* Clients */
.ccard { display: flex; flex-direction: column; gap: 14px; }
.ccard .c-top { display: flex; align-items: center; gap: 12px; }
.ccard .c-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ccard .c-nums div { padding: 10px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.ccard .c-nums b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ccard .c-nums span { font-size: 11.5px; color: var(--muted); }
.ccard .c-strip { display: flex; gap: 4px; height: 48px; }
.ccard .c-strip img, .ccard .c-strip i { flex: 1; min-width: 0; border-radius: 8px; object-fit: cover; background: var(--surface-2); transition: transform .5s var(--ease); }
.ccard:hover .c-strip img { transform: translateY(-2px); }

/* Tableau de bord : bas de page aligné */
.dash-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.dash-row > .card { display: flex; flex-direction: column; min-height: 360px; }
.dash-row .scroll { flex: 1; overflow: auto; margin: 0 -6px; padding: 0 6px; max-height: 340px; scrollbar-width: thin; }
.agenda { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 10px; overflow-x: auto; scrollbar-width: none; }
.agenda::-webkit-scrollbar { display: none; }
.ag-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--line); transition: border-color .2s, background .2s, transform .3s var(--ease); min-width: 0; }
.ag-item:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.ag-date { width: 46px; height: 48px; border-radius: 11px; display: grid; place-content: center; text-align: center; background: var(--surface-3); flex: none; line-height: 1.05; }
.ag-date b { font-size: 18px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ag-date span { font-size: 10.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ag-item.shoot .ag-date { background: #fff; } .ag-item.shoot .ag-date b, .ag-item.shoot .ag-date span { color: #111214; }
.ag-item.exp .ag-date { background: rgba(245,180,84,.14); } .ag-item.exp .ag-date b { color: var(--amber); }
.ag-txt { min-width: 0; flex: 1; }
.ag-txt b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-txt span { font-size: 12px; color: var(--muted); }

/* Équipe */
.team-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--line); background: linear-gradient(120deg, #22232a 0%, #1b1c21 55%, #202126 100%); padding: 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; margin-bottom: 16px; }
.team-hero::before { content: ""; position: absolute; top: -240px; right: -100px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.07), transparent 62%); pointer-events: none; }
.team-hero > * { position: relative; }
.team-hero h1 { font-size: clamp(22px, 2.1vw, 30px); line-height: 1.15; letter-spacing: -.05em; }
.team-hero h1 span { color: #8a8b93; font-weight: 500; }
.team-hero .lead { font-size: 15px; color: var(--text-2); margin: 12px 0 20px; max-width: 520px; }
.team-hero .lead b { color: var(--text); font-weight: 600; }
.av-stack { display: flex; align-items: center; }
.av-stack .avatar { width: 84px; height: 84px; font-size: 26px; border: 4px solid #1d1e23; margin-left: -22px; transition: transform .4s var(--ease); }
.av-stack .avatar:first-child { margin-left: 0; }
.av-stack .avatar:hover { transform: translateY(-6px); z-index: 2; }
.av-stack .more { width: 84px; height: 84px; border-radius: 50%; margin-left: -22px; border: 4px solid #1d1e23; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; font-size: 18px; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.member { position: relative; overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.member .m-cover { position: relative; height: 120px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--surface-2); overflow: hidden; }
.member .m-cover img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); opacity: .85; transition: filter .6s var(--ease), transform .9s var(--ease), opacity .4s; }
.member:hover .m-cover img { filter: none; opacity: 1; transform: scale(1.05); }
.member .m-cover.empty { display: block; background: radial-gradient(300px 140px at 20% 0%, rgba(255,255,255,.1), transparent 70%), linear-gradient(135deg, #26272d, #1c1d21); }
.member .m-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(28,29,33,.9)); pointer-events: none; }
.member .m-body { position: relative; padding: 0 20px 18px; margin-top: -38px; display: flex; flex-direction: column; gap: 3px; z-index: 1; }
.member .avatar.xl { border: 4px solid var(--surface); margin-bottom: 10px; }
.member .m-name { font-size: 18px; font-weight: 600; letter-spacing: -.025em; display: flex; align-items: center; gap: 8px; font-stretch: 92%; }
.member .m-role { font-size: 13px; color: var(--text-2); }
.member .m-mail { font-size: 12.5px; color: var(--muted); }
.member .m-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 14px; }
.member .m-spark i { flex: 1; border-radius: 3px 3px 1px 1px; background: var(--surface-3); min-height: 3px; transition: background .3s; }
.member .m-spark i.on { background: #fff; }
.member .m-spark-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 5px; }
.member .m-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px -20px 0; border-top: 1px solid var(--line); }
.member .m-stats div { padding: 12px 0; text-align: center; }
.member .m-stats div + div { border-left: 1px solid var(--line); }
.member .m-stats b { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.member .m-stats span { font-size: 11.5px; color: var(--muted); }
.member .m-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); margin-top: auto; }
.member .m-badge { position: absolute; top: 12px; right: 12px; z-index: 2; }
.member.off { opacity: .55; }
.member.invite { display: grid; place-items: center; text-align: center; min-height: 300px; background: transparent; border: 1.5px dashed var(--line-2); cursor: pointer; transition: border-color .2s, background .2s; }
.member.invite:hover { border-color: #fff; background: rgba(255,255,255,.02); }
.member.invite .ic-big { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 12px; background: #fff; color: #111214; transition: transform .4s var(--ease); }
.member.invite:hover .ic-big { transform: rotate(-8deg) scale(1.06); }
.role-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role-tiles > div { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.role-tiles b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.role-tiles p { font-size: 13px; margin: 0; }
.role-tiles .n { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* Retouche (LightCraft) */
.lc-app { display: flex; flex-direction: column; height: calc(100vh - 96px); min-height: 560px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.lc-bar { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.lc-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.lc-title b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.015em; line-height: 1.1; }
.lc-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: #111; flex: none; }
.lc-select { appearance: none; border: 0; background: transparent; color: var(--text-2); font-size: 12.5px; padding: 0 16px 0 0; max-width: 280px; cursor: pointer; outline: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23a3a4ab' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right center; text-overflow: ellipsis; }
.lc-select option { background: var(--surface-2); color: var(--text); }
.lc-steps { display: flex; gap: 14px; margin: 0 auto; font-size: 12.5px; color: var(--muted); }
.lc-steps span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.lc-steps i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 700; }
.lc-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.lc-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); max-width: 220px; white-space: nowrap; overflow: hidden; }
.lc-state span:last-child { overflow: hidden; text-overflow: ellipsis; }
.lc-state .dot { width: 7px; height: 7px; background: var(--muted); animation: none; box-shadow: none; }
.lc-state.ok .dot { background: var(--mint); } .lc-state.err .dot { background: var(--coral); } .lc-state.err { color: #ffb5b5; }
.lc-expand { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 11px; border-radius: 10px; border: 1px solid #fff; font-weight: 700; font-size: 13px; color: #111214; background: #fff; transition: transform .28s var(--ease), background .2s; }
.lc-expand:hover { background: #e6e6e9; transform: translateY(-2px); }
.lc-expand:active { transform: scale(.97); }
.lc-body { flex: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; }
.lc-side { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-right: 1px solid var(--line); min-height: 0; background: var(--rail); border-bottom-left-radius: var(--r-lg); }
.lc-seg { display: flex; width: 100%; }
.lc-seg a { flex: 1; justify-content: center; text-align: center; }
.lc-photos { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; align-content: start; scrollbar-width: thin; }
.lc-photos button { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 9px; overflow: hidden; background: var(--surface-2); outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .15s, transform .25s var(--ease); }
.lc-photos button:hover { transform: scale(1.04); }
.lc-photos button img { width: 100%; height: 100%; object-fit: cover; }
.lc-photos button.sent { outline-color: #fff; }
.lc-photos button.saved::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--rail); }
.lc-photos button .sel-h { position: absolute; left: 5px; top: 5px; width: 17px; height: 17px; border-radius: 50%; background: #fff; color: #e0245e; display: grid; place-items: center; }
.lc-dest { padding: 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; }
.lc-dest .row > b { min-width: 0; flex: 1; }
.lc-link { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); flex: none; }
.lc-stage { position: relative; background: #1c1c1c; min-width: 0; contain: strict; border-bottom-right-radius: var(--r-lg); }
.lc-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.lc-status { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--text-2); font-size: 13.5px; pointer-events: none; text-align: center; padding: 20px; }
.lc-loader { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: #fff; animation: spin .8s linear infinite; }
.lc-app.full { position: fixed; inset: 0; z-index: 400; height: auto; border-radius: 0; border: 0; }
.lc-app.full .lc-side, .lc-app.full .lc-stage { border-radius: 0; }
html.lc-full, html.lc-full body { overflow: hidden; }
html.lc-full .sidebar, html.lc-full .topbar, html.lc-full .tabbar, html.lc-full .fab { visibility: hidden; }
html.lc-page .topbar { background: var(--bg); }
html.lc-page .page-enter { animation: none; }
@media (max-width: 1640px) { .lc-app:not(.full) .lc-steps { display: none; } }
@media (max-width: 1240px) { .lc-state { display: none; } }

/* Modèles d'e-mails */
.tpl-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.tpl-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 3px; }
.tpl-nav .grp { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.tpl-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--text-2); transition: background .15s, color .15s; border: 1px solid transparent; }
.tpl-item:hover { background: var(--surface); color: var(--text); }
.tpl-item.on { background: var(--surface-2); color: #fff; border-color: var(--line-2); }
.tpl-item .ti { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; transition: background .2s, color .2s; }
.tpl-item.on .ti { background: #fff; color: #111214; }
.tpl-item b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.tpl-item small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.tpl-item .mod { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #fff; flex: none; }
.mailwin { padding: 0; overflow: visible; }
.mailwin .mw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.mailwin .mw-head h2 { font-size: 16px; }
.mailwin .mw-when { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.mw-line { display: flex; align-items: center; gap: 12px; padding: 4px 18px; border-bottom: 1px solid var(--line); min-height: 48px; }
.mw-line > span:first-child { width: 58px; flex: none; font-size: 13px; color: var(--muted); }
.mw-line .bare { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14px; padding: 10px 0; }
.mw-line .rte-line { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 10px 0; min-height: 0; border-radius: 0; }
.mw-to { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.mailwin .rte { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.mailwin .rte-bar { position: sticky; top: 70px; z-index: 3; border-bottom: 1px solid var(--line); background: var(--surface); padding: 6px 12px; }
.mailwin .rte-body { min-height: 300px; padding: 20px 18px 26px; }
.mailwin .mw-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.rte-bar .ins > button { color: #111214; background: #fff; padding: 0 12px; font-weight: 700; border-radius: 8px; }
.rte-bar .ins > button:hover { background: #e6e6e9; color: #111214; }
.ins { position: relative; }
.ins-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 300px; max-height: 360px; overflow: auto; padding: 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 30px 70px -20px rgba(0,0,0,.8); display: none; }
.ins.open .ins-menu { display: block; animation: pop .2s var(--ease); }
.ins-menu .grp { font-size: 11px; color: var(--muted); padding: 8px 8px 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.ins-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px; border-radius: 9px; font-size: 13px; color: var(--text); }
.ins-menu button:hover { background: var(--surface-3); }
.ins-menu button small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.phone { position: sticky; top: 80px; border-radius: 30px; padding: 10px; background: #0e0f11; border: 1px solid var(--line-2); }
.phone .ph-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 10px; font-size: 11.5px; color: var(--muted); }
.phone .ph-subj { padding: 0 12px 10px; font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.preview-frame { width: 100%; height: 560px; border: 0; border-radius: 22px; background: #f4f4f5; display: block; }
.var.btnvar { background: #fff; color: #111214; border-color: #fff; }
.var.blockvar { background: var(--surface-3); color: var(--text-2); }
.task-tpl ol { margin: 0; padding: 0; list-style: none; counter-reset: t; display: grid; gap: 7px; }
.task-tpl li { counter-increment: t; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); min-width: 0; }
.task-tpl li::before { content: counter(t); width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.card.dashed { background: transparent; border-style: dashed; border-color: var(--line-2); }

/* Préférences de notifications */
.np { width: 100%; border-collapse: collapse; }
.np th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding: 0 8px 10px; }
.np th:first-child { text-align: left; }
.np td { padding: 13px 8px; border-top: 1px solid var(--line); text-align: center; }
.np td:first-child { text-align: left; }
.np td b { display: block; font-weight: 600; font-size: 14px; }
.np td small { color: var(--muted); font-size: 12.5px; }
.tgl { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .25s, border-color .25s; flex: none; margin: 0; vertical-align: middle; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8b8d95; transition: transform .35s var(--ease), background .25s; }
.tgl:checked { background: #fff; border-color: #fff; } .tgl:checked::after { transform: translateX(18px); background: #111214; }

.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: #fff; border-radius: inherit; transition: width .3s var(--ease); }

@media (max-width: 1360px) { .tpl-layout { grid-template-columns: 240px minmax(0, 1fr); } .tpl-layout .phone { grid-column: 2; position: static; } }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } .dash-row { grid-template-columns: 1fr 1fr; } .role-tiles { grid-template-columns: 1fr; } .lc-body { grid-template-columns: 180px minmax(0, 1fr); } .team-hero { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .phead { margin: 4px 0 16px; align-items: flex-start; }
  .phead h1 { font-size: 28px; letter-spacing: -.04em; }
  .phead .actions { width: 100%; }
  .phead .actions .btn { flex: 1; }
  .phead .actions .seg { width: 100%; flex-wrap: nowrap; }
  .phead .actions .seg > * { flex: 1; justify-content: center; }
  .toolbar .search { max-width: none; flex: 1 1 100%; order: -1; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; } .kpi .kpi-v { font-size: 24px; } .kpi .kpi-top { font-size: 12px; } .kpi .kpi-ic { width: 30px; height: 30px; }
  .dash-row { grid-template-columns: 1fr; } .dash-row > .card { min-height: 0; }
  .agenda { grid-auto-columns: 80%; margin: 0 -16px; padding: 0 16px; }
  .tpl-layout { grid-template-columns: 1fr; }
  .tpl-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .tpl-nav .grp { display: none; }
  .tpl-item { flex: none; border-color: var(--line); }
  .tpl-item small { display: none; }
  .tpl-layout .phone { grid-column: auto; }
  .mailwin .rte-bar { top: 62px; }
  .np th:not(:first-child), .np td:not(:first-child) { width: 64px !important; padding-left: 4px; padding-right: 4px; }
  .np td small { display: none; }
  .team-hero { padding: 22px 18px; }
  .av-stack .avatar, .av-stack .more { width: 60px; height: 60px; font-size: 19px; margin-left: -16px; }
  .members { grid-template-columns: 1fr; }
  .pager { padding: 12px; } .pager .pages button:not(.on):not(.nav) { display: none; }
  .btn:hover { transform: none; }
}
@media (hover: none) { a.kpi:hover, .ag-item:hover, .btn:hover { transform: none; } .member .m-cover img { filter: none; opacity: 1; } }

/* Garde-fous anti-débordement mobile */
.grid > *, .split > *, .stack > *, .row > .grow, .card, .list-item, .kpi { min-width: 0; }
.list-item > div { min-width: 0; }
.tabs a .n { font-size: 11px; color: var(--muted); padding: 1px 7px; border-radius: 99px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.t .num, .t .mono { white-space: nowrap; }

/* Statuts : pastilles pleines, couleurs franches */
.st { --s-bg: #2a2b31; --s-fg: #fff; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px 0 8px; border-radius: 7px; background: var(--s-bg); color: var(--s-fg); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; line-height: 1; font-stretch: 100%; }
.st .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.st-draft, .st-todo, .st-cancelled { --s-bg: transparent; --s-fg: #b4b5bc; box-shadow: inset 0 0 0 1.5px #4a4c53; }
.st-sent, .st-review, .st-refunded { --s-bg: #2F6BFF; --s-fg: #fff; }
.st-progress, .st-pending { --s-bg: #FFC400; --s-fg: #111214; }
.st-approved { --s-bg: #ffffff; --s-fg: #111214; }
.st-delivered, .st-paid, .st-done { --s-bg: #00D68F; --s-fg: #04130d; }
.st-expired, .st-failed { --s-bg: #FF3B3B; --s-fg: #fff; }
.st-progress::after, .st-pending::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: 2px; animation: stBlink 1.4s ease-in-out infinite; }
@keyframes stBlink { 50% { opacity: .15; } }
.tl-st { position: absolute; top: 10px; left: 10px; z-index: 2; }
.tl-st .st { box-shadow: 0 6px 18px -6px rgba(0,0,0,.6); }
.tl-st .st-draft { background: rgba(17,18,20,.72); backdrop-filter: blur(6px); }

/* Tableau de bord : Toulouse au trait, animée */
.hero-city { display: flex; align-items: center; justify-content: center; min-width: 0; margin: -10px -6px -30px 0; }
.city { width: 100%; max-width: 620px; height: auto; overflow: visible; }
.city .lines path, .city .wheel path { stroke: #f2f2f4; stroke-width: 2; }
.city path.d { stroke-dasharray: 1; stroke-dashoffset: 1; animation: cityDraw 1.8s var(--ease) forwards; animation-delay: var(--d); }
@keyframes cityDraw { to { stroke-dashoffset: 0; } }
.city .wheel { transform-box: view-box; transform-origin: 565px 165px; animation: cityWheel 38s linear 2.6s infinite; }
@keyframes cityWheel { to { transform: rotate(360deg); } }
.city .sun { transform-box: view-box; transform-origin: 338px 96px; opacity: 0; animation: sunRise 1.6s var(--ease) .9s forwards; }
@keyframes sunRise { from { opacity: 0; transform: translateY(26px) scale(.7); } to { opacity: 1; transform: none; } }
.city .sun-core { fill: #FFD60A; stroke: none; }
.city .sun-glow { fill: rgba(255,214,10,.14); stroke: none; transform-box: view-box; transform-origin: 338px 96px; animation: sunGlow 4s ease-in-out 2.5s infinite; }
@keyframes sunGlow { 50% { transform: scale(1.18); opacity: .55; } }
.city .rays { transform-box: view-box; transform-origin: 338px 96px; animation: cityWheel 50s linear infinite; }
.city .rays line { stroke: #FFD60A; stroke-width: 2.4; }
.city .water path { stroke: rgba(255,255,255,.45); stroke-width: 1.6; stroke-dasharray: 18 12; animation: cityWater 6s linear infinite; }
.city .water path:nth-child(2) { stroke: rgba(255,255,255,.28); animation-duration: 8s; animation-direction: reverse; }
.city .water path:nth-child(3) { stroke: rgba(255,255,255,.16); animation-duration: 11s; }
@keyframes cityWater { to { stroke-dashoffset: -120; } }
.city .birds path { stroke: #d4d5da; stroke-width: 1.6; animation: cityBirds 9s ease-in-out infinite alternate; }
.city .birds path + path { animation-delay: -4s; }
@keyframes cityBirds { from { transform: translate(-6px, 3px); } to { transform: translate(14px, -5px); } }
@media (max-width: 1180px) { .hero-city { display: flex; margin: 8px 0 -14px; } .city { max-width: 520px; } }
@media (prefers-reduced-motion: reduce) { .city path.d { stroke-dashoffset: 0; } .city .sun { opacity: 1; } }

/* Compte en haut à droite */
.umenu { position: relative; flex: none; }
.ubtn { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px 0 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: background .2s, border-color .2s; max-width: 240px; }
.ubtn:hover, .umenu.open .ubtn { background: var(--surface-2); border-color: var(--line-2); }
.ubtn .avatar { border-radius: 9px; }
.u-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.2; text-align: left; }
.u-txt b { font-weight: 600; font-size: 13px; max-width: 150px; }
.u-txt small { font-size: 11.5px; color: var(--muted); max-width: 150px; }
.u-chev { color: var(--muted); display: inline-flex; transition: transform .3s var(--ease); }
.umenu.open .u-chev { transform: rotate(180deg); }
.udrop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 30px 70px -20px rgba(0,0,0,.85); z-index: 60; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity .2s, transform .3s var(--ease); }
.umenu.open .udrop { opacity: 1; transform: none; pointer-events: auto; }
.u-head { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.u-head b { font-weight: 600; font-size: 13.5px; } .u-head small { color: var(--muted); font-size: 12px; }
.udrop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--text-2); transition: background .15s, color .15s; }
.udrop a:hover { background: var(--surface-3); color: #fff; }
.udrop hr { margin: 4px 0; }
.udrop .u-out:hover { color: #ff8a8a; }
.topbar .brand.only-m .logo { width: 34px; height: 34px; border-radius: 10px; }
@media (max-width: 900px) { .ubtn { padding: 0; border: 0; background: none; height: auto; } .ubtn .avatar { width: 38px; height: 38px; border-radius: 50%; } .udrop { position: fixed; right: 12px; top: calc(60px + env(safe-area-inset-top, 0px)); } }
.seg.vt a { padding: 0 9px; }
.t-thumb { width: 44px; height: 34px; border-radius: 8px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--muted); }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }
.page-head > div > p { display: none; }
.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.hero-city { align-items: flex-end; margin: -24px -24px -34px 0; }
.city { max-width: 700px; }
@media (max-width: 1180px) { .hero { grid-template-columns: 1fr; } .hero-city { margin: 4px -10px -22px; } }
