/* Be Legal — système de design de l'application */
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(23, 105, 224, .06), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(18, 176, 124, .05), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f1f3f8;
  --border: #e6e9f0;
  --border-strong: #d5dae4;
  --text: #0f1b2d;
  --text-2: #475467;
  --muted: #7a8699;
  --brand: #1769e0;
  --brand-2: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eaf2fe;
  --brand-strong: #0b1f3a;
  --accent: #12b07c;
  --focus: #1769e0;
  --green: #0f8a5f; --green-soft: #e3f6ee;
  --amber: #a15c07; --amber-soft: #fff3dc;
  --red: #c4302b; --red-soft: #fdecea;
  --blue: #1d5fc2; --blue-soft: #e8f0fd;
  --violet: #5b3fd1; --violet-soft: #efebfd;
  --gray: #5d6779; --gray-soft: #eef0f4;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px -2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .25);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 264px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0f17; --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(23, 105, 224, .14), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(18, 176, 124, .08), transparent 60%);
    --surface: #111826; --surface-2: #161f30; --surface-3: #1b2639; --border: #222d40; --border-strong: #2e3b52;
    --text: #e9eef6; --text-2: #b3bfd0; --muted: #8391a7;
    --brand: #4c8dff; --brand-2: #7c74ff; --brand-soft: #14284a; --brand-strong: #070d18; --focus: #6ea2ff;
    --green: #47d39c; --green-soft: #0f3326; --amber: #f3b54e; --amber-soft: #3a2a10; --red: #ff8a84; --red-soft: #3d1717;
    --blue: #8db8ff; --blue-soft: #14284a; --violet: #b4a8ff; --violet-soft: #241d4a; --gray: #a8b3c4; --gray-soft: #1e2839;
    --series-1: #3987e5; --series-2: #d95926;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px -2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f17; --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(23, 105, 224, .14), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(18, 176, 124, .08), transparent 60%);
  --surface: #111826; --surface-2: #161f30; --surface-3: #1b2639; --border: #222d40; --border-strong: #2e3b52;
  --text: #e9eef6; --text-2: #b3bfd0; --muted: #8391a7;
  --brand: #4c8dff; --brand-2: #7c74ff; --brand-soft: #14284a; --brand-strong: #070d18; --focus: #6ea2ff;
  --green: #47d39c; --green-soft: #0f3326; --amber: #f3b54e; --amber-soft: #3a2a10; --red: #ff8a84; --red-soft: #3d1717;
  --blue: #8db8ff; --blue-soft: #14284a; --violet: #b4a8ff; --violet-soft: #241d4a; --gray: #a8b3c4; --gray-soft: #1e2839;
  --series-1: #3987e5; --series-2: #d95926;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px -2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed; color: var(--text); font: 14.5px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.02em; }
h1 { font-size: 24px; font-weight: 720; }
h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
h3 > .ic { color: var(--muted); }
.ic { flex: none; }
.muted { color: var(--muted); font-weight: 400; }
.neg { color: var(--red) !important; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.grow { flex: 1; }
.center { text-align: center; }
.small { font-size: 12px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.anim > * { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.stagger > * { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms + 80ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.splash { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; }
.splash img { animation: pop .6s var(--spring) both; }
.spin { width: 20px; height: 20px; border: 2.5px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.loading-block { padding: 8px 0; display: grid; gap: 12px; }
.skel { height: 14px; border-radius: 8px; background: var(--surface-3); position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.2s infinite; }
.skel.lg { height: 90px; border-radius: var(--radius); }
.skel.w60 { width: 60%; } .skel.w40 { width: 40%; } .skel.w80 { width: 80%; }

/* ---------- Mise en page ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: linear-gradient(180deg, #0d2342 0%, #091a33 55%, #071427 100%); color: #c9d6e8; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; padding-top: var(--safe-t); border-right: 1px solid rgba(255, 255, 255, .04); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand img { border-radius: 9px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.brand b { display: block; font-size: 17px; color: #fff; letter-spacing: -.02em; }
.brand small { display: block; font-size: 12px; color: #8ea6c4; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav { flex: 1; padding: 4px 12px 12px; }
.nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #6f88a8; padding: 18px 10px 6px; font-weight: 650; display: flex; align-items: center; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: #c9d6e8; font-size: 13.5px; font-weight: 500; position: relative; transition: background .2s, color .2s, transform .2s var(--ease); }
.nav-link .ic { opacity: .8; transition: opacity .2s, transform .25s var(--spring); }
.nav-link:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.nav-link:hover .ic { opacity: 1; transform: scale(1.08); }
.nav-link.active { background: linear-gradient(90deg, rgba(76, 141, 255, .22), rgba(76, 141, 255, .06)); color: #fff; font-weight: 620; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(#5aa2ff, #12b07c); animation: fade .3s; }
.nav-link.active .ic { opacity: 1; color: #8cc0ff; }
.nav-lock { font-size: 9px; background: rgba(255, 255, 255, .12); color: #fff; padding: 1px 6px; border-radius: 6px; margin-left: 6px; letter-spacing: .04em; }
.side-foot { padding: 10px 12px 14px; border-top: 1px solid rgba(255, 255, 255, .06); display: grid; gap: 2px; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 28px; padding-top: calc(10px + var(--safe-t)); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.topbar-title { font-size: 16px; font-weight: 650; display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 0 12px; color: var(--muted); box-shadow: var(--shadow-xs); transition: border-color .2s, box-shadow .2s; }
.global-search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 15%, transparent); }
.global-search input { border: 0; background: transparent; padding: 9px 0; flex: 1; outline: none; font: inherit; color: var(--text); min-height: 0; box-shadow: none !important; }
.global-search kbd { font: 600 11px/1 "Inter", sans-serif; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; }
.topbar .bell { margin-left: auto; position: relative; }
.dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; animation: pop .4s var(--spring), pulse-ring 1.6s 2; border: 2px solid var(--bg); box-sizing: content-box; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; text-decoration: none !important; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent); transition: transform .2s var(--spring); }
.avatar:hover { transform: scale(1.06); }
.lang-switch { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 2px; }
.lang-switch button { border: 0; background: transparent; font: 650 11.5px "Inter", sans-serif; color: var(--muted); padding: 5px 8px; border-radius: 7px; cursor: pointer; transition: all .2s; }
.lang-switch button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
main { padding: 26px 28px 40px; max-width: 1320px; width: 100%; margin: 0 auto; outline: none; }
main.page-enter > * { animation: rise .42s var(--ease) both; }
main.page-enter > *:nth-child(2) { animation-delay: 40ms; } main.page-enter > *:nth-child(3) { animation-delay: 80ms; }
main.page-enter > *:nth-child(4) { animation-delay: 120ms; } main.page-enter > *:nth-child(n+5) { animation-delay: 160ms; }
.scrim, .tabbar, .only-mobile, .icon-btn.only-mobile { display: none; }

/* ---------- Composants ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-bottom: 10px; color: var(--muted); font-weight: 550; transition: color .2s, transform .2s; }
.back:hover { color: var(--text); text-decoration: none; transform: translateX(-2px); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h3 { margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card.flush .panel-head { padding: 16px 18px 0; }
.link { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.group-title { margin: 26px 0 12px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 13.5px; border-radius: var(--radius-sm); padding: 9px 15px; border: 1px solid transparent; cursor: pointer; background: var(--surface); color: var(--text); text-decoration: none !important; white-space: nowrap; min-height: 38px; position: relative; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, filter .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, #fff), var(--brand)); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 4px 12px -2px color-mix(in srgb, var(--brand) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 2px 4px rgba(16, 24, 40, .1), 0 8px 18px -4px color-mix(in srgb, var(--brand) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18); transform: translateY(-1px); }
.btn.ghost { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-xs); }
.btn.ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-2)); }
.btn.danger { background: var(--red); color: #fff; }
.danger-text { color: var(--red) !important; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; min-height: 32px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading .ic { opacity: 0; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.ghost.loading::after { border-color: var(--border); border-top-color: var(--brand); }
.btn-group { display: inline-flex; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex: none; transition: background .2s, color .2s, transform .15s; }
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 620; line-height: 1.65; white-space: nowrap; background: var(--blue-soft); color: var(--blue); vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.xs { font-size: 10.5px; padding: 0 7px; }
.badge.xs::before { width: 5px; height: 5px; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--gray-soft); color: var(--gray); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 13.5px; flex-wrap: wrap; border: 1px solid transparent; animation: rise .4s var(--ease); }
.notice > span { flex: 1; min-width: 200px; }
.notice.info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 15%, transparent); }
.notice.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 15%, transparent); }
.notice.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 18%, transparent); }
.notice .ic { color: var(--blue); }
.notice.warn .ic { color: var(--amber); }
.notice.ok .ic { color: var(--green); }
.install-banner { display: flex; align-items: center; gap: 10px; margin: 14px 28px 0; padding: 11px 14px; background: linear-gradient(90deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 40%, var(--surface))); border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent); border-radius: 12px; font-size: 13.5px; animation: rise .5s var(--ease); }
.install-banner span { flex: 1; }
.install-banner > .ic { color: var(--brand); }
.install-banner.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 18%, transparent); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--surface); box-shadow: var(--shadow-md); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 11px; color: var(--muted); min-width: 220px; flex: 1; max-width: 360px; transition: border-color .2s, box-shadow .2s; }
.search-input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 14%, transparent); }
.search-input input { border: 0 !important; outline: none; background: transparent; padding: 8px 0 !important; flex: 1; min-width: 0; box-shadow: none !important; }
.search-input.big { max-width: none; margin-bottom: 18px; padding: 5px 15px; font-size: 16px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 40px; width: 100%; transition: border-color .2s, box-shadow .2s; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8699' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.toolbar select, .toolbar input[type=date], .inline-field input { width: auto; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 15%, transparent); }
input.invalid { border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); padding: 0; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); min-width: 0; }
.field small, .help { font-weight: 400; color: var(--muted); font-size: 12px; margin: 0; }
.field.full, .full { grid-column: 1 / -1; }
.field.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--text); padding-top: 22px; font-size: 13.5px; }
.req { color: var(--red); font-style: normal; }
.input-suffix, .input-prefix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.input-suffix input, .input-prefix input { border: 0; box-shadow: none !important; }
.input-suffix span { padding: 0 11px; color: var(--muted); font-size: 12px; font-weight: 600; }
.input-prefix span { padding: 0 2px 0 11px; color: var(--muted); font-weight: 600; }
.input-suffix:focus-within, .input-prefix:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 15%, transparent); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-section, .detail-section { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 20px 0 4px; padding-top: 14px; border-top: 1px dashed var(--border); font-weight: 650; }
.form-section:first-child, .detail-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); display: flex; gap: 8px; flex-wrap: wrap; }

/* Tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; z-index: 1; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.r { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr[data-href], tr[data-entry] { cursor: pointer; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
table.data tbody tr[data-href]:hover .primary-cell { color: var(--brand); }
.card:not(.flush) .table-wrap { margin: 0 -20px; }
.card:not(.flush) .table-wrap table th:first-child, .card:not(.flush) .table-wrap table td:first-child { padding-left: 20px; }
.primary-cell { font-weight: 620; transition: color .15s; }
.w1 { width: 1%; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { margin-left: 4px; }
table.compact td, table.compact th { padding: 8px 10px; }
.empty-cell { text-align: center; color: var(--muted); padding: 30px; }
table.report td { padding: 7px 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
table.report tr.row-section td { background: var(--brand-soft); font-weight: 700; color: var(--text); }
table.report tr.row-subtotal td { background: var(--surface-2); font-weight: 650; }
table.report tr.row-total td { background: var(--surface-3); font-weight: 700; }
table.report tr.row-grand td { background: linear-gradient(90deg, var(--brand-soft), var(--surface-2)); font-weight: 800; border-top: 2px solid var(--border-strong); }
.report-title { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--border); }
.report-title small { color: var(--muted); }
.lines-editor input, .lines-editor select { min-height: 34px; padding: 6px 8px; }
.lines-editor td { padding: 6px; vertical-align: top; }
.lines-editor .acc { width: 110px; }
.lines-editor .acc-l { display: block; font-size: 11px; max-width: 160px; }
.lines-editor .deb, .lines-editor .cre { width: 130px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.progress { display: inline-block; width: 64px; height: 6px; background: var(--gray-soft); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 3px; transform-origin: left; animation: grow .8s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* Fiche */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 22px; }
.kv > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kv > div { font-weight: 520; word-break: break-word; }
.kv.full { grid-column: 1 / -1; }
.tabs { display: flex; gap: 2px; margin: 26px 0 0; overflow-x: auto; background: var(--surface-3); padding: 4px; border-radius: 12px 12px 0 0; border: 1px solid var(--border); border-bottom: 0; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; color: var(--text-2); padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: all .2s var(--ease); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
#tab-body { border-top-left-radius: 0; border-top-right-radius: 0; animation: fade .3s; }

/* Documents */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); transition: background .15s; }
.doc:hover { background: var(--surface-2); }
.card:not(.flush) .doc { padding-left: 0; padding-right: 0; }
.card:not(.flush) .doc:hover { background: transparent; }
.doc:last-child { border-bottom: 0; }
.doc-ic { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, var(--surface))); color: var(--brand); display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; border: 1px solid color-mix(in srgb, var(--brand) 12%, transparent); }
.doc-main { flex: 1; min-width: 0; }
.doc-main a { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.doc-main small { color: var(--muted); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 26px; align-items: center; text-align: center; cursor: pointer; color: var(--text-2); position: relative; transition: all .2s var(--ease); background: var(--surface-2); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); }
.dropzone .ic { color: var(--brand); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.picked { font-size: 13px; display: flex; align-items: center; gap: 6px; padding: 2px 0; animation: rise .3s; }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpis.small { margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; color: var(--text); box-shadow: var(--shadow); text-decoration: none !important; position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; isolation: isolate; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--kpi-c, var(--brand)) 16%, transparent), transparent 70%); z-index: -1; transition: transform .4s var(--ease); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--kpi-c, var(--brand)) 30%, var(--border)); }
.kpi:hover::after { transform: scale(1.4); }
.kpi.tone-green { --kpi-c: var(--green); } .kpi.tone-amber { --kpi-c: var(--amber); } .kpi.tone-red { --kpi-c: var(--red); } .kpi.tone-violet { --kpi-c: var(--violet); } .kpi.tone-blue { --kpi-c: var(--blue); }
.kpi-ic { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--kpi-c, var(--brand)) 13%, transparent); color: var(--kpi-c, var(--brand)); }
.kpi-label, .kpi > span { font-size: 12.5px; color: var(--text-2); font-weight: 600; padding-right: 42px; }
.kpi b { font-size: 28px; font-weight: 760; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; }
.kpi b small { margin-left: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.kpi > small { color: var(--muted); font-size: 12px; }
.kpis.small .kpi b { font-size: 19px; }
.kpi.red b { color: var(--red); }
.hello { display: flex; align-items: center; gap: 12px; }
.hello .wave { display: inline-block; animation: wave 1.8s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40%, 100% { transform: rotate(0); } }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.dash-grid .card { margin: 0; }
.dash-grid .card.wide { grid-column: 1 / -1; }
.alert-list { display: flex; flex-direction: column; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; border-radius: 8px; transition: background .15s, transform .2s var(--ease); }
.card.flush .alert-row { padding: 13px 18px; border-radius: 0; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: var(--surface-2); }
.alert-row:hover > .ic { transform: translateX(3px); color: var(--brand); }
.alert-row .when { min-width: 96px; justify-content: center; }
.alert-row.tone-red .when { animation: pulse-ring 2s 1; }
.alert-main { flex: 1; min-width: 0; }
.alert-main b { display: block; font-weight: 600; font-size: 13.5px; }
.alert-main small { color: var(--muted); font-size: 12px; }
.alert-row > .ic { color: var(--muted); transition: transform .2s var(--ease), color .2s; }
.task-list, .missing-list, .perm-list { list-style: none; margin: 0; padding: 0; }
.task-list li, .missing-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); transition: opacity .3s; }
.task-list li:last-child, .missing-list li:last-child { border-bottom: 0; }
.task-list input { margin-top: 3px; }
.task-list a, .missing-list a { color: var(--text); text-decoration: none; flex: 1; min-width: 0; }
.task-list a:hover b, .missing-list a:hover b { color: var(--brand); }
.task-list b, .missing-list b { display: block; font-weight: 600; font-size: 13.5px; transition: color .15s; }
.task-list small, .missing-list small { color: var(--muted); font-size: 12px; }
.task-list li.done { opacity: .5; }
.task-list li.done b { text-decoration: line-through; }
.perm-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.s1, .viz .s1 { background: var(--series-1); fill: var(--series-1); }
.sw.s2, .viz .s2 { background: var(--series-2); fill: var(--series-2); }
.viz { width: 100%; height: auto; display: block; overflow: visible; }
.viz text { font-size: 11px; fill: var(--muted); font-family: "Inter", sans-serif; }
.viz .base { stroke: var(--border-strong); stroke-width: 1; }
.viz path { transform-box: fill-box; transform-origin: bottom; animation: bar .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); transition: opacity .2s; }
.viz path:hover { opacity: .75; }
@keyframes bar { from { transform: scaleY(0); } }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(80px, 140px) 1fr 32px; gap: 10px; align-items: center; font-size: 13px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hb-track { height: 10px; background: var(--gray-soft); border-radius: 5px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .8s var(--ease) both; }
.hbars b { text-align: right; font-variant-numeric: tabular-nums; }

/* Comptabilité */
.treso-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.treso { text-align: left; font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: var(--text); box-shadow: var(--shadow); transition: all .25s var(--ease); }
.treso:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.treso.active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent), var(--shadow-md); }
.treso span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.treso b { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.treso b small, .treso > small { font-size: 12px; color: var(--muted); font-weight: 500; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.op-card { text-align: left; font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; color: var(--text); box-shadow: var(--shadow); transition: all .25s var(--ease); }
.op-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.op-card:hover .op-ic { transform: scale(1.08) rotate(-4deg); }
.op-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--violet-soft) 70%, var(--surface))); color: var(--brand); display: grid; place-items: center; transition: transform .3s var(--spring); }
.op-card b { font-size: 13.5px; }
.op-card small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.preview { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface-2); animation: rise .35s var(--ease); }
.preview b { display: block; margin-bottom: 6px; }
.entry-head { margin-bottom: 14px; }
.entry-head b { font-size: 16px; display: block; }
.entry-head small { color: var(--muted); }
.secret { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.secret code { font-size: 18px; flex: 1; font-weight: 700; letter-spacing: .5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Notifications */
.notif-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.notif { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.notif.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: middle; }
.notif p { margin: 2px 0; font-size: 13.5px; color: var(--text-2); }
.notif small { color: var(--muted); font-size: 12px; }
.notif-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.lvl-danger .notif-ic { background: var(--red-soft); color: var(--red); }
.lvl-warning .notif-ic { background: var(--amber-soft); color: var(--amber); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); padding: 40px 16px; animation: fade .4s; }
.empty .ic { width: 52px; height: 52px; padding: 13px; border-radius: 16px; background: var(--surface-3); color: var(--muted); }
.empty p { margin: 0; max-width: 420px; font-size: 13.5px; }

/* Fenêtres */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(8, 15, 28, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .32s var(--spring); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; font-weight: 680; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body p { margin-top: 0; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; padding-bottom: calc(14px + var(--safe-b)); border-top: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 18px 18px; }
.confirm-msg { font-size: 15px; }
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(480px, calc(100% - 32px)); }
.toast { background: #0f1b2d; color: #fff; padding: 12px 16px; border-radius: 12px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow-lg); font-size: 13.5px; transition: opacity .35s, transform .35s var(--ease); pointer-events: auto; animation: pop .4s var(--spring); border: 1px solid rgba(255, 255, 255, .08); }
.toast.ok .ic { color: #47d39c; }
.toast.error { background: #7f1d1d; }
.toast.out { opacity: 0; transform: translateY(10px) scale(.98); }
.toast-action { color: #fff; font-weight: 700; text-decoration: underline; margin-left: 4px; white-space: nowrap; }

/* Connexion */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-side { position: relative; overflow: hidden; background: radial-gradient(800px 500px at 20% 10%, #1d4ed8 0%, transparent 60%), radial-gradient(700px 500px at 90% 90%, #0e9f6e 0%, transparent 55%), #0b1f3a; color: #dce7f7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%); }
.auth-side > * { position: relative; }
.auth-side h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 760; color: #fff; letter-spacing: -.03em; max-width: 520px; line-height: 1.15; }
.auth-side h2 em { font-style: normal; background: linear-gradient(90deg, #7cc4ff, #5eead4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 10px; align-items: center; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 200ms); }
.auth-side li .ic { color: #5eead4; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 18px; background: var(--bg); background-image: var(--bg-grad); }
.auth-card { background: var(--surface); width: min(420px, 100%); border-radius: 20px; padding: 30px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .5s var(--spring); }
.brand.big { padding: 0 0 22px; }
.brand.big b { color: var(--text); font-size: 21px; }
.brand.big small { color: var(--muted); }
.auth-card h1 { font-size: 21px; margin-bottom: 18px; }
.switch { text-align: center; font-size: 13.5px; margin: 16px 0 0; color: var(--text-2); }
.auth-foot { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; text-align: center; }
.auth-top { display: flex; justify-content: space-between; align-items: center; width: min(420px, 100%); }
.auth-top a { font-size: 13px; color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; }

/* Abonnement */
.plan-now { font-size: 20px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 700; }
.usage { margin-bottom: 14px; font-size: 13px; }
.usage > span { font-weight: 600; color: var(--text-2); }
.meter-top { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.meter-bar { height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.meter-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 4px; transform-origin: left; animation: grow .9s var(--ease) both; }
.meter-bar i.high { background: var(--amber); }
.meter-bar i.full { background: var(--red); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 7px 13px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .2s var(--ease); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .45; cursor: default; }
.pay-method { width: 100%; }
.pay-method button { flex: 1; justify-content: center; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 24px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px; position: relative; box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s; }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.plan.featured { border: 0; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--brand), var(--accent)) border-box; border: 2px solid transparent; }
.plan-flag { position: absolute; top: -11px; left: 18px; background: linear-gradient(90deg, var(--brand), var(--accent)); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; box-shadow: var(--shadow-md); }
.plan h4 { margin: 0; font-size: 15px; font-weight: 700; }
.plan-price b { font-size: 26px; letter-spacing: -.03em; font-weight: 780; }
.plan-price span { color: var(--muted); font-size: 13px; margin-left: 4px; }
.plan-sub { margin: 0; color: var(--muted); font-size: 12px; }
.plan ul { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; flex: 1; }
.plan li { display: flex; gap: 7px; align-items: flex-start; }
.plan li .ic { color: var(--green); margin-top: 2px; }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.pay-total b { font-size: 24px; letter-spacing: -.02em; }
.pay-wait { display: flex; gap: 14px; align-items: center; padding: 10px 0; animation: rise .4s; }
.pay-wait p { margin: 0; }

/* ---------- Téléphone ---------- */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-104%); transition: transform .32s var(--ease); width: min(300px, 86vw); padding-bottom: var(--safe-b); box-shadow: var(--shadow-lg); }
  body.menu-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 15, 28, .45); opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .only-mobile, .icon-btn.only-mobile { display: inline-grid; }
  .global-search { display: none; }
  .topbar { padding: 8px 10px; padding-top: calc(8px + var(--safe-t)); gap: 2px; }
  .topbar-title { display: block; flex: 1; }
  .topbar .bell { margin-left: 0; }
  .avatar, .topbar .lang-switch, .topbar .theme-btn { display: none; }
  main { padding: 18px 16px calc(92px + var(--safe-b)); }
  .install-banner { margin: 10px 16px 0; }
  .page-head h1 { font-size: 21px; }
  .page-head .actions .btn span { display: none; }
  .page-head .actions .btn { padding: 9px 11px; }
  .tabbar { display: flex; position: fixed; bottom: 10px; left: 10px; right: 10px; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border: 1px solid var(--border); border-radius: 18px; margin-bottom: var(--safe-b); box-shadow: var(--shadow-lg); padding: 4px; }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font: inherit; font-size: 10.5px; font-weight: 600; color: var(--muted); background: none; border: 0; text-decoration: none !important; position: relative; border-radius: 14px; transition: color .2s, background .2s; }
  .tabbar .active { color: var(--brand); background: var(--brand-soft); }
  .tabbar .active .ic { animation: pop .35s var(--spring); }
  .tab-dot { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; display: grid; place-items: center; padding: 0 4px; }
  .toolbar .search-input { max-width: none; min-width: 100%; }
  .toolbar > select, .toolbar .inline-field { flex: 1; }
  .btn-group .btn span { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 13px; }
  .kpi b { font-size: 22px; }
  .kpi-ic { display: none; }
  .kpi-label, .kpi > span { padding-right: 0; }
  #toasts { bottom: calc(96px + var(--safe-b)); }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { padding: 12px 16px; border-bottom: 1px solid var(--border); position: relative; }
  table.data td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; font-size: 13.5px; }
  table.data td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex: none; max-width: 45%; }
  table.data td.primary-cell { font-size: 15px; text-align: left; justify-content: flex-start; padding-bottom: 4px; }
  table.data td.primary-cell::before { display: none; }
  table.data td:not([data-label])::before { display: none; }
  table.data td.w1 { position: absolute; right: 16px; top: 13px; width: auto; }
  table.data td.row-actions { justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }
  table.lines-editor tr { padding: 10px 0; }
  table.lines-editor td { text-align: left; }
  .lines-editor .acc, .lines-editor .deb, .lines-editor .cre { width: 60%; }
  table.lines-editor tfoot tr, table.lines-editor tfoot td { display: block; }
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; animation: up .38s var(--ease); }
  .modal::before { content: ""; width: 38px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; }
  .modal-foot { border-radius: 0; }
  .grid-form { grid-template-columns: 1fr; }
  .doc { padding: 11px 16px; }
  .alert-row .when { min-width: 82px; }
  .cols { grid-template-columns: 1fr; }
  .field.check { padding-top: 4px; }
  input, select, textarea { font-size: 16px; }
}
@media print {
  .sidebar, .topbar, .tabbar, .toolbar, .actions, .chips, #banner { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
