/* ARC CRM v2 — design system. Stone chaud, accent bleu ARC, or assoupli pour les mises en avant, mono pour les données. */
:root {
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #eeece7; --surface-3: #e6e3dc; --line: #dedbd3; --line-2: #cfcbc2;
  --fg: #1f1d1a; --fg-2: #5c5852; --fg-3: #8a857c; --fg-4: #b3aea4;
  --accent: #0b4491; --accent-2: #2e6fe8; --accent-soft: #e4ecf9; --accent-ink: #082f66;
  --gold: #b8841f; --gold-soft: #f7efdc;
  --ok: #2f7d4f; --ok-soft: #e1f0e6; --warn: #b26a00; --warn-soft: #fbefd9; --danger: #b3261e; --danger-soft: #fae3e1; --info: #2e6fe8; --info-soft: #e4ecf9;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --r: 8px; --r-lg: 12px; --shadow: 0 1px 2px rgba(31,29,26,.05), 0 4px 14px rgba(31,29,26,.06); --shadow-lg: 0 8px 32px rgba(31,29,26,.14);
  --ease: cubic-bezier(.32,.72,.32,1); --sidebar-w: 236px; --topbar-h: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font: 14.5px/1.5 var(--font); letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
p { margin: 0 0 10px; } p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
a.link { font-weight: 500; }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .94em; }
kbd { font: 11px var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--fg-3); }
.muted { color: var(--fg-3); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.ico { flex: none; vertical-align: -4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r); z-index: 100; }
.skip:focus { left: 8px; }
.only-mobile { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

/* ---------- Coque : barre latérale + en-tête ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transition: transform .28s var(--ease); }
.brand { display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--fg); font-weight: 600; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.wordmark-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font: 600 12px/1 var(--font); letter-spacing: .02em; }
.brand-text { font-size: 15px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); font-weight: 500; padding: 6px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--fg-2); font-weight: 500; font-size: 14px; transition: background .15s var(--ease), color .15s var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.soon { color: var(--fg-4); cursor: default; } .nav-item.soon:hover { background: transparent; color: var(--fg-4); }
.nav-item em { margin-left: auto; font: 10.5px var(--font); font-style: normal; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-4); }
.sidebar-foot { padding: 10px 18px; border-top: 1px solid var(--line); color: var(--fg-4); font-size: 12px; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(31,29,26,.35); z-index: 35; }

.shell { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs { font-size: 12px; color: var(--fg-3); display: flex; gap: 6px; }
.crumbs a { color: var(--fg-3); }
.topsearch { flex: 0 1 380px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px 0 12px; height: 36px; color: var(--fg-3); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.topsearch:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.topsearch input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--fg); outline: none; }
.topsearch input::placeholder { color: var(--fg-4); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.space-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.space-switch a { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--fg-2); text-decoration: none; white-space: nowrap; }
.space-switch a:hover { color: var(--fg); background: var(--surface); }
.space-switch a.active { background: var(--accent); color: #fff; }
.arc-home-btn { height: 34px; border-radius: 999px; } .arc-home-btn.is-active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.tenant-switch.is-empty select { color: var(--fg-3); }
.topbar .tenant-switch { flex: none; } .tenant-switch select { min-width: 150px; }
.tenant-switch { display: flex; align-items: center; gap: 6px; color: var(--fg-3); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; height: 34px; }
.tenant-switch select { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--fg); max-width: 190px; outline: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--fg-2); cursor: pointer; transition: background .15s var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.user-menu summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 3px 8px 3px 3px; border-radius: 999px; color: var(--fg-2); font-weight: 500; font-size: 13.5px; }
.user-menu summary:hover { background: var(--surface-2); }
.user-menu summary::-webkit-details-marker { display: none; }
.dropdown { position: relative; }
.dropdown .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; }
.menu-head span { font-size: 12px; color: var(--fg-3); }
.dropdown .menu a, .dropdown .menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r); color: var(--fg); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown .menu a:hover, .dropdown .menu button:hover { background: var(--surface-2); text-decoration: none; }
.content { flex: 1; padding: 24px; max-width: 1480px; width: 100%; }

/* ---------- Pages publiques (connexion) ---------- */
body.public { display: flex; min-height: 100vh; }
.public-wrap { margin: auto; width: 100%; max-width: 420px; padding: 32px 16px; }
.public-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 32px 28px; box-shadow: var(--shadow); }
.wordmark { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-weight: 600; }
.public-title { font-size: 22px; margin-bottom: 4px; }
.public-sub { color: var(--fg-3); margin-bottom: 20px; }
.public-foot { text-align: center; color: var(--fg-4); font-size: 12.5px; margin-top: 18px; }
.public-foot a { color: var(--fg-3); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font: 500 14px var(--font); letter-spacing: -.01em; cursor: pointer; white-space: nowrap; transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease); }
.btn:hover { background: var(--surface-2); border-color: var(--fg-4); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); } .btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; } .btn-danger:hover { background: #8f1d17; border-color: #8f1d17; }
.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); } .btn-outline:hover { background: var(--accent-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; } .btn-lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 14px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; } .form-row.between { justify-content: space-between; }
.form-grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-all { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--fg-2); }
.field label .req { color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; letter-spacing: -.01em; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a857c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--fg-4); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--surface-2); color: var(--fg-2); }
input.money, input.num { text-align: right; font-family: var(--mono); }
.field-hint { font-size: 12.5px; color: var(--fg-3); }
.field-error { font-size: 12.5px; color: var(--danger); margin: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--fg-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.form-foot { margin-top: 4px; font-size: 13.5px; }
.input-group { display: flex; } .input-group > * { border-radius: 0; } .input-group > :first-child { border-radius: var(--r) 0 0 var(--r); } .input-group > :last-child { border-radius: 0 var(--r) var(--r) 0; }
.addon { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-left: 0; background: var(--surface-2); color: var(--fg-3); font-size: 13px; }

/* ---------- Cartes, KPI, grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; min-width: 0; }
.card-title { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.h-greet { font-size: 22px; }
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--fg-3); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; }
.kpi-hint { font-size: 12px; color: var(--fg-4); margin-top: 2px; }
.kpi-delta { font-size: 12.5px; font-weight: 500; } .kpi-delta.up { color: var(--ok); } .kpi-delta.down { color: var(--danger); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.dl dt { color: var(--fg-3); font-size: 13.5px; } .dl dd { margin: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.empty { text-align: center; padding: 40px 20px; color: var(--fg-3); }
.empty .ico { width: 34px; height: 34px; color: var(--fg-4); margin-bottom: 8px; }
.empty h3 { color: var(--fg-2); margin-bottom: 4px; }

/* ---------- Badges, pastilles ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-4); flex: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); } .badge-ok::before { background: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); } .badge-warn::before { background: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); } .badge-danger::before { background: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--accent); } .badge-info::before { background: var(--accent-2); }
.badge-gold { background: var(--gold-soft); color: var(--gold); } .badge-gold::before { background: var(--gold); }
.badge.no-dot::before { display: none; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); color: var(--fg-2); font-size: 12px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { position: sticky; top: 0; background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 500; white-space: nowrap; z-index: 1; }
.table th[data-sort] { cursor: pointer; user-select: none; } .table th[data-sort]:hover { color: var(--fg); }
.table th[data-dir="asc"]::after { content: " ↑"; } .table th[data-dir="desc"]::after { content: " ↓"; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tr.clickable { cursor: pointer; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.num { font-family: var(--mono); }
.table-compact th, .table-compact td { padding: 8px 12px; }
.table .actions { text-align: right; white-space: nowrap; } .table .actions .btn { visibility: hidden; } .table tr:hover .actions .btn, .table tr:focus-within .actions .btn { visibility: visible; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-3); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.cur { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--fg-2); }
.pagination a:hover { background: var(--surface-2); text-decoration: none; } .pagination span.cur { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { flex: none; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--fg-3); font: 500 14px var(--font); letter-spacing: -.01em; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--fg); text-decoration: none; }
.tabs .active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { margin-left: 6px; font: 500 11.5px var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 999px; color: var(--fg-3); }

/* ---------- Messages ---------- */
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash, .alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.flash span, .alert span { flex: 1; }
.flash-success, .alert-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: #1f5b38; }
.flash-error, .alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: #7f1a14; }
.flash-warning, .alert-warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: #6f4300; }
.flash-info, .alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--accent-2) 30%, transparent); color: var(--accent-ink); }
.flash-close { margin-left: auto; border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 0; display: grid; place-items: center; } .flash-close:hover { opacity: 1; }
.alert { margin-bottom: 14px; }

/* ---------- Modales ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); width: min(680px, calc(100vw - 32px)); max-height: min(90dvh, 900px); }
dialog.modal-sm { width: min(440px, calc(100vw - 32px)); } dialog.modal-lg { width: min(960px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(31,29,26,.42); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; overflow-y: auto; max-height: calc(90dvh - 140px); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-body .modal-actions { padding: 16px 0 0; border-top: 0; }
.confirm-text { font-size: 15px; }

/* ---------- Divers ---------- */
.error-page { max-width: 460px; margin: 60px auto; text-align: center; }
.error-code { font-size: 54px; color: var(--fg-4); font-weight: 500; letter-spacing: -.04em; }
.error-page h2 { font-size: 20px; margin: 4px 0 8px; }
.error-page p { color: var(--fg-2); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; } .progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); } .dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.danger { background: var(--danger); }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .topsearch { flex-basis: 260px; }
  .only-desktop { display: none !important; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .shell { margin-left: 0; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topsearch { display: none; }
  .tenant-switch select { max-width: 120px; }
  .content { padding: 16px; }
  .card { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 8px; }
  .public-card { padding: 24px 20px; }
  .table .actions .btn { visibility: visible; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar, .flashes { display: none !important; } .shell { margin: 0; } .content { padding: 0; max-width: none; } .card, .table-wrap { border: 0; } }
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.kpi-link { color: inherit; display: block; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); } .kpi-link:hover { text-decoration: none; border-color: var(--fg-4); box-shadow: var(--shadow); }
.chart { width: 100%; min-height: 200px; } .chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-2); margin-top: 6px; } .chart-legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; } .chart-tip { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; pointer-events: none; z-index: 5; } .chart-tip strong { display: block; margin-bottom: 4px; }
[hidden] { display: none !important; }

/* Cloche de notifications */
.notif-menu summary{position:relative}
.notif-count{position:absolute;top:2px;right:2px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--danger, #b42318);color:#fff;font:600 10px/16px var(--font-mono, monospace);text-align:center}
.notif-panel{width:360px;max-width:calc(100vw - 32px);padding:0}
.notif-panel .menu-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.notif-panel .menu-head form{margin:0}
.notif-panel .link{background:none;border:0;padding:0;color:var(--accent);cursor:pointer;font:inherit;font-size:12px}
.notif-panel .notif-item{display:grid;grid-template-columns:28px 1fr;gap:10px;padding:8px 12px;border-top:1px solid var(--line);color:var(--fg);text-decoration:none}
.notif-panel .notif-item:hover{background:var(--surface-2)}
.notif-panel .notif-item.unread{background:var(--accent-soft)}
.notif-panel .notif-item .ico{width:28px;height:28px;border-radius:999px;display:grid;place-items:center;background:var(--surface-2);color:var(--accent)}
.notif-panel .notif-item strong{display:block;font-weight:500;font-size:13px}
.notif-panel .notif-item span{display:block;font-size:12px;color:var(--fg-3)}
.notif-panel .menu-foot{display:block;padding:10px 12px;border-top:1px solid var(--line);text-align:center;font-size:13px}

/* Aide intégrée */
.help-panel{position:fixed;top:0;right:0;bottom:0;width:380px;max-width:100vw;background:var(--surface);border-left:1px solid var(--line);box-shadow:-8px 0 30px rgba(0,0,0,.08);z-index:950;display:flex;flex-direction:column}
.help-head{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line)}
.help-tabs{display:flex;border-bottom:1px solid var(--line)}.help-tabs button{flex:1;background:none;border:0;border-bottom:2px solid transparent;padding:10px 6px;font:inherit;font-size:13px;color:var(--fg-2);cursor:pointer}.help-tabs button.active{color:var(--fg);border-bottom-color:var(--accent);font-weight:500}.help-tabs .count:empty{display:none}
.help-body{flex:1;overflow:auto;padding:14px;line-height:1.5}.help-body h4{margin:0 0 6px;font-size:15px}.help-actions{display:grid;gap:8px;margin-top:10px}.help-action{padding:8px 10px;border:1px solid var(--line);border-radius:var(--r)}.help-action p{margin:2px 0 0}.help-tips{margin-top:12px;padding:8px 10px;background:var(--accent-soft);border-radius:var(--r)}.help-tips p{margin:0 0 4px}
.help-faq{border-bottom:1px solid var(--line);padding:6px 0}.help-faq summary{cursor:pointer;font-size:13.5px;font-weight:500}.help-faq p{margin:6px 0}
.help-step{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-bottom:1px solid var(--line);cursor:pointer}.help-step.done strong{text-decoration:line-through;color:var(--fg-3)}.help-step input{margin-top:3px}
.help-foot{padding:10px 14px;border-top:1px solid var(--line)}
.notes-body h3{font-size:14px;margin:14px 0 6px}.notes-body ul{padding-left:18px;display:grid;gap:4px}.notes-body p{margin:0 0 8px}

/* Lignes de la grille des taux importées d'AR Groupement */
.grp-row td:first-child{box-shadow:inset 3px 0 0 var(--gold,#c9a227)}.grp-row td{background:color-mix(in srgb,var(--gold,#c9a227) 6%,transparent)}

/* Grille des logos des compagnies partenaires (classeur cabinet) */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.logo-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 10px 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.logo-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.logo-tile:hover { border-color: var(--fg-4); }
.logo-tile.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft, rgba(37, 99, 235, .15)); }
.logo-tile.is-static { cursor: default; }
.logo-tile .logo-name { font-size: 12.5px; text-align: center; line-height: 1.25; color: var(--fg-2); }
.logo-tile.is-on .logo-name { color: var(--fg); font-weight: 500; }
.logo-tile .logo-check { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--accent); color: #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.logo-tile.is-on .logo-check { opacity: 1; transform: scale(1); }
.logo-tile:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-box { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; border-radius: var(--r); background: #fff; overflow: hidden; }
.logo-box img { max-width: 92%; max-height: 48px; object-fit: contain; }
.logo-box-sm { width: 64px; height: 36px; border: 1px solid var(--line); }
.logo-box-sm img { max-height: 30px; }
.logo-initials { font: 600 15px/1 var(--mono); letter-spacing: .04em; color: var(--fg-3); }

/* ---------- Barre d'outils des listes : recherche + fenêtre « Filtres » ---------- */
.toolbar-form .topsearch.inline, .toolbar .topsearch.inline { border-radius: var(--r); height: 36px; flex: 0 1 320px; }
.toolbar-form input[type="search"], .toolbar-form input[type="text"], .toolbar-form input[type="date"] { height: 36px; }
.filters-btn .count { margin-left: 2px; }
.filters-btn.is-on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
dialog.filters-modal { width: min(760px, calc(100vw - 32px)); }
.filters-modal .modal-body { display: grid; gap: 16px; }
.filters-modal .filters-group { display: grid; gap: 10px; }
.filters-modal .filters-group > h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); margin: 0; }
.filters-modal .form-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.filters-modal .check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.filters-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }
.filters-chips .chip-f { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 500; }
.filters-chips .chip-f a { color: inherit; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; } .filters-chips .chip-f a:hover { background: rgba(29,78,216,.15); text-decoration: none; }
.table .status-sel, .table select.inline-sel { height: 28px; padding: 0 24px 0 8px; font-size: 12.5px; background-position: right 6px center; }
.empty svg { width: 34px; height: 34px; color: var(--fg-4); margin-bottom: 8px; }
/* Tableaux de documents et listes d'actions : lignes denses */
.doc-section .table td, .doc-section .table th { padding: 6px 10px; }
.doc-validate { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 6px; }
.doc-validate form { display: inline; }
.table .actions .btn-sm { height: 26px; width: 26px; padding: 0; }
/* Sélecteur segmenté (Client / Prospect…) */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg-opt { position: relative; } .seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-opt span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; font-size: 13.5px; font-weight: 500; color: var(--fg-3); cursor: pointer; }
.seg-opt + .seg-opt span { border-left: 1px solid var(--line-2); }
.seg-opt input:checked + span { background: var(--accent); color: #fff; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: -2px; }
/* Kanban : glisser-déposer */
.task[draggable="true"] { cursor: grab; } .task.is-dragging { opacity: .5; cursor: grabbing; }
.kanban-col.is-over { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-soft); }

/* Sélecteur de fiche / palette (toutes les pages : la recherche de l'en-tête l'utilise) */
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; z-index: 60; display: none; min-width: 320px; }
.picker-list.open { display: block; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.picker-item:hover, .picker-item.active { background: var(--surface-2); }
.picker-item .muted { font-size: 12px; }
.picker-empty { padding: 10px 12px; color: var(--fg-3); font-size: 13px; }
.topsearch .picker-list { left: auto; right: 0; width: 420px; max-width: calc(100vw - 32px); }

/* Actions d'en-tête de page : boutons espacés, retour à la ligne sur mobile */
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions form.form-row { margin: 0; }
.pagination-js { margin-bottom: 4px; } .pagination-js button { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r); border: 0; background: none; color: var(--fg-2); font: inherit; cursor: pointer; } .pagination-js button:hover { background: var(--surface-2); }
