/* IMMODZ — feuille de style
   Bleu marine et or. Les chiffres et titres en Marcellus (capitales romaines gravées),
   le texte courant en Hanken Grotesk, l'arabe en IBM Plex Sans Arabic.
   Propriétés logiques (inline-start/end) partout : l'interface se retourne d'elle-même en arabe. */

:root {
  --navy-950: #0A1730;
  --navy-900: #0F2140;
  --navy-800: #19304D;
  --navy-700: #1E3762;
  --navy-500: #4A5F86;
  --navy-100: #E8EDF5;
  --navy-50: #F3F5FA;
  --gold: #D09F58;
  --gold-700: #8C6A2E;
  --gold-300: #DCC48F;
  --gold-100: #F6EEDD;
  --paper: #F4F6FA;
  --surface: #FFFFFF;
  --ink: #15203A;
  --ink-2: #3A4560;
  --muted: #6A748B;
  --line: #E3E7EF;
  --line-strong: #CCD3E0;
  --green: #2B7553; --green-bg: #E4F1EA;
  --amber: #9C6316; --amber-bg: #FAF0DD;
  --red: #AE3A31; --red-bg: #F8E5E3;
  --blue: #2A58A3; --blue-bg: #E6EDF8;
  --radius: 10px;
  --radius-sm: 7px;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --sidebar: 252px;
  --shadow: 0 1px 2px rgba(15, 33, 64, .06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--paper); }
[dir="rtl"] body { font-family: var(--arabic), var(--font); font-size: 15px; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-700); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .6em; }
code { background: var(--navy-50); padding: 1px 6px; border-radius: 4px; font-size: .92em; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--navy-900); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { top: 12px; color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { text-align: end; font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-lg { width: 40px; height: 40px; }

/* ---------- Structure ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--navy-900); color: #C8D1E2;
  display: flex; flex-direction: column; padding: 18px 12px 14px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; color: #fff; }
.brand:hover { color: #fff; }
.logo-mark { width: 38px; height: 38px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--display); font-size: 21px; letter-spacing: .12em; color: #fff; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--gold-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: #C8D1E2; font-weight: 500; font-size: 14px;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.is-active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold);
}
[dir="rtl"] .nav-item.is-active::before { border-radius: 3px 0 0 3px; }
.nav-item.is-active .ic { color: var(--gold-300); }
.nav-count { margin-inline-start: auto; background: var(--gold); color: var(--navy-950); font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 0 7px; min-width: 22px; text-align: center; }
.nav-group { margin: 18px 12px 6px; font-size: 12px; color: #8D99B3; }
.sidebar-foot { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button {
  flex: 1; background: transparent; border: 1px solid rgba(255, 255, 255, .12); color: #C8D1E2; border-radius: 6px;
  padding: 6px 4px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.lang-switch button.is-active { background: var(--gold); border-color: var(--gold); color: var(--navy-950); font-weight: 600; }
.lang-switch button[lang="ar"] { font-family: var(--arabic); }

.scrim { display: none; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 28px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.icon-btn.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 38px; padding-inline: 38px 12px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); font: inherit; color: var(--ink); }
.search input:focus { outline: none; border-color: var(--navy-500); background: #fff; }
.agency-filter select { height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font: inherit; font-weight: 600; color: var(--navy-800); background: #fff; }
.usermenu { position: relative; margin-inline-start: auto; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px; border-radius: 8px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--paper); }
.usermenu-name { display: flex; flex-direction: column; line-height: 1.2; }
.usermenu-name span { font-weight: 600; font-size: 13.5px; }
.usermenu-name small { color: var(--muted); }
.usermenu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 200px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15, 33, 64, .12); padding: 6px; z-index: 50;
}
.usermenu-panel a, .usermenu-panel button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 6px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: start;
}
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--paper); }
.content { padding: 26px 32px 60px; max-width: 1360px; width: 100%; }
.content:focus { outline: none; }

/* ---------- Avatars ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar-0 { background: var(--navy-100); color: var(--navy-800); }
.avatar-1 { background: var(--gold-100); color: var(--gold-700); }
.avatar-2 { background: #E6EFEA; color: #2B6049; }
.avatar-3 { background: #EEE8F3; color: #5A3E78; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.person > span { display: flex; flex-direction: column; line-height: 1.3; }
.person small { color: var(--muted); }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--navy-900); letter-spacing: .01em; }
[dir="rtl"] .page-title { font-family: var(--arabic); font-weight: 600; font-size: 26px; }
.page-head .muted { margin: 4px 0 0; }
.crumb { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--ink-2); }
.ref { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy-800); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--navy-500); color: var(--navy-900); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #962F27; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: transparent; padding-inline: 8px; }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-block { width: 100%; }
.btn-call { background: var(--navy-800); color: #fff; font-variant-numeric: tabular-nums; }
.btn-call:hover { background: var(--navy-700); color: #fff; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy-800); cursor: pointer; }
.icon-btn:hover { border-color: var(--navy-500); }
.mini { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--navy-800); cursor: pointer; }
.mini:hover { border-color: var(--navy-500); }
.mini-danger { color: var(--red); width: 28px; justify-content: center; padding: 0; font-size: 16px; }
.inline { display: inline; }
form.inline .btn-danger-ghost { height: 28px; }

/* ---------- Segmented / onglets ---------- */
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; padding: 3px; gap: 2px; }
.segmented a { padding: 6px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.segmented a:hover { background: var(--paper); color: var(--ink); }
.segmented a.is-active { background: var(--navy-800); color: #fff; }
.segmented-icons a { padding: 5px 8px; display: inline-grid; place-items: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.is-active { color: var(--navy-900); border-bottom-color: var(--gold); }
.tab-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--navy-50); color: var(--ink-2); font-size: 12px; text-align: center; margin-inline-start: 4px; }
.tabs a.is-active .tab-count { background: var(--gold-100); color: var(--gold-700); }

/* ---------- Registre de chiffres (signature IMMODZ) ---------- */
.ledger {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.ledger-results { background: var(--navy-900); border-color: var(--navy-900); }
.ledger-results .figure { border-color: rgba(255, 255, 255, .1); }
.ledger-results .figure-value { color: #fff; }
.ledger-results .figure-label { color: #AEB9CF; }
.ledger-results a.figure:hover { background: var(--navy-800); }
.ledger-results .figure-gold .figure-value { color: var(--gold-300); }
.figure { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 20px 15px; border-inline-start: 1px solid var(--line); color: inherit; min-width: 0; }
.figure:first-child { border-inline-start: 0; }
a.figure:hover { background: var(--navy-50); color: inherit; }
.figure-value { font-family: var(--display); font-size: 30px; line-height: 1.1; color: var(--navy-900); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.figure-sub { font-size: 12.5px; color: var(--ink-2); }
.figure-gold .figure-value { color: var(--gold-700); }
.figure-alert .figure-value { color: var(--red); }
.figure .hbar { margin-top: 8px; height: 6px; }
.ledger-compact .figure-value { font-size: 24px; }

/* ---------- Panneaux ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { font-size: 15.5px; font-weight: 700; color: var(--navy-900); }
.panel-head a { font-size: 13px; font-weight: 600; }
.panel-empty { margin: 4px 0; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.dash-grid > .panel { margin-bottom: 0; }
.dash-grid + .dash-grid, .dash-grid + .dash-lists, .dash-grid + .panel { margin-top: 14px; }
.dash-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.dash-lists .panel { margin-bottom: 0; }
.panel-team { grid-column: 1 / -1; }

/* Listes de lignes */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a, .rows li > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; color: var(--ink); }
.rows a:hover { color: var(--navy-700); }
.rows a > span:first-child, .rows li > span > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.rows small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .when { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 4px 6px; border-radius: 6px; background: var(--navy-50); font-size: 12px; color: var(--ink-2); flex: none; }
.rows .when strong { font-size: 14px; color: var(--navy-900); }
.rows a:has(.when) { justify-content: flex-start; }
.rows a:has(.when) > span:last-child { display: flex; flex-direction: column; min-width: 0; }

/* Échéances */
.due { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: 10px; }
.due-late { color: var(--red); background: var(--red-bg); }
.due-today { color: var(--amber); background: var(--amber-bg); }
.due-soon { color: var(--amber); background: var(--amber-bg); }
.due-later { color: var(--ink-2); background: var(--navy-50); }
small.due-late { background: none; padding: 0; }

/* Badges */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-navy { background: var(--navy-100); color: var(--navy-800); }
.badge-gold { background: var(--gold-100); color: var(--gold-700); }
.badge-grey { background: #EEF0F3; color: #6B7280; }
.badge-plain { background: transparent; color: var(--ink-2); border: 1px solid var(--line-strong); }

/* ---------- Graphiques ---------- */
.bars { width: 100%; height: auto; display: block; overflow: visible; }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars rect { fill: var(--gold-300); }
.bars .is-current rect { fill: var(--gold); }
.bars g:hover rect { fill: var(--gold-700); }
.bars .bar-label { font-size: 11px; fill: var(--muted); text-anchor: middle; font-family: var(--font); }
.bars .bar-value { font-size: 10.5px; fill: var(--ink-2); text-anchor: middle; font-family: var(--font); font-variant-numeric: tabular-nums; }
.bars-dual rect.in { fill: var(--navy-700); }
.bars-dual rect.out { fill: var(--gold-300); }
.chart-note { font-size: 12px; margin: 6px 0 0; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-start: 8px; }
.key-in { background: var(--navy-700); }
.key-out { background: var(--gold-300); }
.hbar { display: block; width: 100%; height: 8px; }
.hbar-track { fill: var(--navy-50); }
.hbar-fill { fill: var(--gold); }
[dir="rtl"] .hbar { transform: scaleX(-1); }
.hbar-lg { height: 10px; }
.bar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.bar-list strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-cell { display: grid; grid-template-columns: 1fr 34px; align-items: center; gap: 8px; min-width: 120px; }
.bar-cell strong { text-align: end; font-variant-numeric: tabular-nums; }

/* Agences au tableau de bord */
.agency-rows { display: grid; gap: 10px; }
.agency-row { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.agency-row-btn { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; align-items: center; gap: 14px; width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: start; }
.agency-row-btn:hover .agency-row-name { color: var(--gold-700); }
.agency-row-name { display: flex; flex-direction: column; font-weight: 700; color: var(--navy-900); }
.agency-row-name small { font-weight: 400; color: var(--muted); }
.agency-row-rev { font-family: var(--display); font-size: 20px; color: var(--gold-700); white-space: nowrap; }
.agency-row-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 0; }
.agency-row-stats div { display: flex; flex-direction: column; }
.agency-row-stats dt { font-size: 12px; color: var(--muted); }
.agency-row-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.agency-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.agency-card .code { font-family: var(--display); font-weight: 400; color: var(--gold-700); margin-inline-start: 6px; letter-spacing: .08em; }
.agency-card .actions { margin-top: 14px; }

/* ---------- Tableaux ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--navy-50); white-space: nowrap; }
.table th.num { text-align: end; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: #FAFBFD; }
.table td small { color: var(--muted); }
.table tfoot th, .table tfoot td { background: var(--navy-50); font-weight: 700; border-top: 1px solid var(--line-strong); padding: 11px 14px; }
.table-compact th, .table-compact td { padding: 8px 10px; }
.panel .table th { background: transparent; }
.panel .table-wrap { box-shadow: none; }
.is-inactive td, .is-inactive { opacity: .6; }
.sort { color: inherit; }
.sort.is-active { color: var(--navy-900); }
.row-link { color: var(--navy-900); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-count { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.pager .pager-count { margin: 0; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-strong); background: #fff; font-weight: 600; font-size: 13.5px; }
.pager-links .is-current { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type="search"], .filters input[type="text"], .filters select, .filters input[type="date"] {
  height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 11px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); min-width: 0;
}
.filters input[type="search"] { flex: 1 1 220px; max-width: 340px; }
.filters .w-sm { width: 120px; }
.filters-inline { margin: 0; align-items: flex-end; }
.filters-inline .field { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.link-reset { font-size: 13px; font-weight: 600; }

/* ---------- Formulaires ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 24px 20px; box-shadow: var(--shadow); max-width: 1040px; }
fieldset { border: 0; padding: 0; margin: 0; }
.form-card fieldset { padding: 18px 0 8px; border-bottom: 1px solid var(--line); }
.form-card fieldset:last-of-type { border-bottom: 0; }
legend { font-weight: 700; color: var(--navy-900); font-size: 15px; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
[dir="rtl"] legend { float: right; }
legend ~ * { clear: both; }
.grid-2, .grid-3 { display: grid; gap: 0 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 11px; font: inherit; color: var(--ink); background: #fff;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .filters :is(input, select):focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(30, 55, 98, .12); }
.field input[type="file"] { padding: 7px; min-height: 0; background: var(--paper); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12.5px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12.5px; }
.field-check { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 10px; align-self: end; min-height: 40px; }
.field-check label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
.field-check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--navy-800); }
.input-unit { position: relative; }
.input-unit input { padding-inline-end: 42px; font-variant-numeric: tabular-nums; }
.input-unit span { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; font-weight: 600; pointer-events: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; flex-wrap: wrap; }
.form-actions form.inline { margin-inline-end: auto; }
.form-actions-inline { padding-top: 0; }
.stack { display: block; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; padding-top: 14px; margin-top: 10px; border-top: 1px dashed var(--line-strong); }
.inline-form .field { margin: 0; flex: 1 1 150px; }
.inline-form > .btn { margin-top: 24px; }
.fee-preview { margin: 0 0 8px; padding: 10px 14px; background: var(--gold-100); border-radius: 8px; color: var(--gold-700); font-size: 14px; }
.fee-preview:empty { display: none; }
.fee-preview strong { font-family: var(--display); font-size: 18px; font-weight: 400; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.thumbs img { width: 92px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.tranche-table { max-width: 460px; margin-bottom: 6px; }
.tranche-table input { width: 100%; height: 36px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 10px; font: inherit; }
.examples ul { margin: 4px 0 12px; padding-inline-start: 18px; color: var(--ink-2); }

/* Propriétaire : liste ou nouveau */
.owner-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 2px; margin-bottom: 14px; background: var(--navy-50); }
.owner-switch { margin-bottom: 14px; }
.owner-switch label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.owner-switch label.is-active { background: var(--navy-800); color: #fff; }
.owner-switch input { position: absolute; opacity: 0; pointer-events: none; }
.owner-switch label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.owner-pane .grid-3 { margin-bottom: 0; }

/* Cases à cocher (documents légaux) */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 6px; }
.check-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.check-card:hover { border-color: var(--navy-500); }
.check-card input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy-800); flex: none; }
.check-card:has(input:checked) { border-color: var(--navy-700); background: var(--navy-50); color: var(--navy-900); }
.checks.has-error .check-card { border-color: var(--red); }
.doc-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.doc-checks li { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.doc-checks li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 4px; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* ---------- Fiches ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.detail-side { position: sticky; top: 74px; }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts-wide div { grid-template-columns: 200px 1fr; }
.prose { white-space: normal; color: var(--ink-2); max-width: 75ch; }
.panel-price .big-price { font-family: var(--display); font-size: 32px; color: var(--navy-900); margin: 0; line-height: 1.15; }
.big-price small { font-family: var(--font); font-size: 14px; color: var(--muted); }
.panel-price > .muted { margin-bottom: 10px; }
.danger-zone { text-align: center; padding: 6px 0; }
.danger-panel { border-color: #EBC9C5; }
.note-warn { background: var(--amber-bg); color: var(--amber); padding: 10px 12px; border-radius: 8px; margin: 12px 0 0; font-weight: 500; }
.validity { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* Timeline des échanges */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 14px; padding-inline-start: 22px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--gold); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline-head .muted { font-size: 12.5px; }
.timeline-head form { margin-inline-start: auto; }
.timeline p { margin: 4px 0 0; color: var(--ink-2); }

/* Galerie */
.gallery-main img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 8px; background: var(--navy-50); }
.gallery-thumbs { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gallery-thumbs li { position: relative; }
.gallery-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.thumb-actions { position: absolute; inset-inline-end: 4px; top: 4px; display: flex; gap: 4px; }
.thumb-actions .mini { height: 24px; font-size: 11.5px; padding: 0 7px; }
.thumb-actions .mini-danger { width: 24px; padding: 0; }
.gallery-empty { display: grid; place-items: center; gap: 6px; padding: 30px 0; color: var(--navy-500); background: var(--navy-50); border-radius: 8px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.upload-row input[type="file"] { flex: 1 1 200px; font: inherit; font-size: 13px; }
.files { list-style: none; margin: 0 0 6px; padding: 0; }
.files li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; }
.files a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); }
.files a span { display: flex; flex-direction: column; min-width: 0; }
.files a span, .files small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files small { color: var(--muted); }

/* Cartes de biens */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s; }
.pcard:hover { border-color: var(--gold-300); color: var(--ink); }
.pcard-media { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(160deg, var(--navy-100), var(--navy-50)); display: grid; place-items: center; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pcard-placeholder { color: var(--navy-500); opacity: .6; }
.pcard-op { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--navy-900); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 11px; }
.pcard-body { display: flex; flex-direction: column; gap: 4px; padding: 13px 15px 14px; flex: 1; }
.pcard-price { font-family: var(--display); font-size: 22px; color: var(--navy-900); line-height: 1.15; }
.pcard-price small { font-family: var(--font); font-size: 13px; color: var(--muted); }
.pcard-title { font-weight: 600; font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.pcard-specs { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.pcard-ref { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.pcard-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }

/* Prospection */
.calls { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.call { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.call-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.call-name { font-weight: 700; font-size: 15px; color: var(--navy-900); }
.call-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.call-dial { display: flex; gap: 6px; }
.call-log { display: contents; }
.call-log > summary { list-style: none; }
.call-log > summary::-webkit-details-marker { display: none; }
.call-log[open] > summary { background: var(--navy-50); }
.call-form { grid-column: 1 / -1; border-top: 1px dashed var(--line-strong); padding-top: 14px; }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.outcomes legend { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip input:checked + span { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Agenda */
.week { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 220px; display: flex; flex-direction: column; gap: 6px; }
.day header { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; font-size: 13px; color: var(--muted); }
.day header strong { font-family: var(--display); font-size: 18px; font-weight: 400; color: var(--navy-900); }
.day.is-today { border-color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.day.is-weekend { background: #FAFBFC; }
.day-empty { text-align: center; margin: 10px 0; }
.slot { display: flex; flex-direction: column; padding: 7px 9px; border-radius: 7px; background: var(--navy-50); border-inline-start: 3px solid var(--navy-700); color: var(--ink); font-size: 12.5px; line-height: 1.35; }
.slot:hover { background: var(--navy-100); color: var(--ink); }
.slot-time { font-weight: 700; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.slot-title { font-weight: 600; }
.slot-meta { color: var(--muted); }
.slot-effectue { border-inline-start-color: var(--green); background: var(--green-bg); }
.slot-annule { border-inline-start-color: #9CA3AF; opacity: .6; text-decoration: line-through; }
.slot-reporte { border-inline-start-color: var(--amber); background: var(--amber-bg); }

/* Export */
.export-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.export-item { display: flex; gap: 12px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.export-item:hover { border-color: var(--gold-300); color: var(--ink); }
.export-item span { display: flex; flex-direction: column; }
.export-item small { color: var(--muted); }
.export-item .ic { color: var(--gold-700); }
.export-backup { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.export-backup:hover { color: #fff; }
.export-backup small { color: #AEB9CF; }

/* Messages */
.flash { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; border: 1px solid transparent; }
.flash-success { background: var(--green-bg); color: var(--green); border-color: #C6E1D2; }
.flash-error { background: var(--red-bg); color: var(--red); border-color: #EBC9C5; }
.flash-info { background: var(--blue-bg); color: var(--blue); border-color: #C9D8EF; }
.flash-close { background: none; border: 0; font-size: 20px; line-height: 1; color: inherit; cursor: pointer; padding: 0 4px; }
.flash-floating { position: fixed; top: 16px; inset-inline: 16px; z-index: 60; max-width: 520px; margin: 0 auto; box-shadow: 0 8px 24px rgba(15, 33, 64, .12); }
.empty { text-align: center; padding: 46px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty p { max-width: 52ch; margin: 0 auto 14px; }
.error-page { text-align: center; padding: 70px 20px; }
.error-code { font-family: var(--display); font-size: 72px; color: var(--gold); margin: 0; line-height: 1; }
.error-page h1 { font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--navy-900); margin: 10px 0; }

/* Fenêtre de confirmation */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(10, 23, 48, .45); padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 12px; padding: 22px; max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(10, 23, 48, .3); }
.modal-card p { font-size: 15px; font-weight: 500; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.roles-help { margin-top: 18px; }
.search-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

/* ---------- Connexion ---------- */
.guest { background: var(--surface); }
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.login-side { background: var(--navy-900); color: #fff; display: grid; place-items: center; padding: 40px; position: relative; overflow: hidden; }
.login-side::after {
  content: ""; position: absolute; inset: auto -10% -45% auto; width: 90%; aspect-ratio: 1; border: 1px solid rgba(201, 165, 92, .25); transform: rotate(45deg);
}
.login-side-inner { position: relative; z-index: 1; max-width: 420px; }
.logo-lg { width: 64px; height: 64px; margin-bottom: 22px; }
.login-word { font-family: var(--display); font-size: clamp(46px, 7vw, 76px); letter-spacing: .14em; line-height: 1; margin: 0; }
.login-slogan { font-family: var(--display); font-size: 20px; color: var(--gold-300); margin: 14px 0 34px; }
[dir="rtl"] .login-slogan { font-family: var(--arabic); }
.login-agencies { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #C8D1E2; }
.login-agencies li { display: flex; align-items: center; gap: 10px; }
.login-agencies .ic { color: var(--gold); }
.login-main { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 80px); gap: 22px; }
.login-form { max-width: 400px; width: 100%; }
.login-form h1 { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--navy-900); margin-bottom: 6px; }
[dir="rtl"] .login-form h1 { font-family: var(--arabic); font-weight: 600; }
.login-form > .muted { margin-bottom: 22px; }
.login-form .btn { height: 44px; margin-top: 6px; }
.lang-inline { max-width: 400px; }
.lang-inline button { border-color: var(--line-strong); color: var(--ink-2); }
.demo-accounts { max-width: 520px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-accounts h2 { font-size: 15px; margin-bottom: 4px; }
.demo-accounts ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.demo-fill { width: 100%; text-align: start; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font: inherit; cursor: pointer; display: flex; flex-direction: column; color: var(--ink); }
.demo-fill:hover { border-color: var(--gold-300); }
.demo-fill strong { font-size: 13px; color: var(--navy-900); }
.demo-fill span { font-size: 12.5px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .detail { grid-template-columns: minmax(0, 1fr) 300px; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  [dir="rtl"] .sidebar { transform: translateX(102%); }
  .sidebar-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10, 23, 48, .4); z-index: 35; display: none; }
  .sidebar-open .scrim { display: block; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 20px 16px 50px; }
  .usermenu-name { display: none; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 36px 24px; }
  .login-side::after { display: none; }
  .login-word { font-size: 44px; }
  .login-slogan { margin-bottom: 18px; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .page-title { font-size: 25px; }
  .agency-filter { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure { border-inline-start: 0; border-top: 1px solid var(--line); padding: 13px 14px; }
  .ledger-results .figure { border-top-color: rgba(255, 255, 255, .1); }
  .figure:nth-child(-n+2) { border-top: 0; }
  .figure:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .ledger-results .figure:nth-child(even) { border-inline-start-color: rgba(255, 255, 255, .1); }
  .figure-value { font-size: 24px; }
  .form-card { padding: 4px 16px 16px; }
  .filters input[type="search"] { max-width: none; flex-basis: 100%; }
  .filters select { flex: 1 1 140px; }
  /* Les tableaux deviennent des cartes */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-wrap:has(.table-cards) { background: none; border: 0; box-shadow: none; overflow: visible; }
  .table-cards tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; padding: 6px 14px; }
  .table-cards td { display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; align-content: start; padding: 6px 0; border-bottom: 1px solid var(--line); text-align: start; }
  .table-cards td.num { text-align: start; }
  .table-cards td:last-child { border-bottom: 0; }
  .table-cards td > * { grid-column: 2; }
  .table-cards td::before { grid-column: 1; grid-row: 1 / span 3; content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; }
  .table-cards td:not([data-label])::before { content: ""; }
  .table-cards tfoot { display: none; }
  .call { grid-template-columns: 1fr; }
  .call-dial .btn-call { flex: 1; }
  .call-log > summary { width: 100%; }
  .agency-row-btn { grid-template-columns: 1fr auto; }
  .agency-row-bar { grid-column: 1 / -1; grid-row: 2; }
  .facts div, .facts-wide div { grid-template-columns: 110px 1fr; }
  .bar-list li { grid-template-columns: 100px 1fr auto; }
  .week { grid-template-columns: repeat(7, minmax(150px, 1fr)); }
  .page-head .actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .actions, .filters, .pager, form, .danger-zone { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .panel, .table-wrap, .ledger { box-shadow: none; break-inside: avoid; }
}

/* ---------- Espace propriétaire ---------- */
.portal { background: var(--paper); }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px clamp(16px, 4vw, 40px); background: var(--navy-900); }
.portal-top .brand { padding: 0; }
.portal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) { .portal-tools .lang-switch button { min-width: 0; padding-inline: 10px; } .portal-tools .btn-ghost { padding-inline: 10px; } }
.portal-tools .lang-switch button { min-width: 74px; }
.portal-main { max-width: 1040px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 60px; }
.portal-card { max-width: 440px; margin: 30px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.portal-card .login-form { max-width: none; margin-top: 18px; }
.portal-card .hint { margin-top: 14px; }

/* Document du mandat (fiche mandat) */
.doc-panel { border-color: var(--gold-300); background: linear-gradient(180deg, var(--gold-100), #fff 70%); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-actions .btn-wa { background: #1f8f4e; color: #fff; }
.doc-actions .btn-wa:hover { background: #18753f; color: #fff; }
.access-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--gold-300); border-radius: 8px; background: #fff; }
.access-box dl { margin: 6px 0 0; display: grid; grid-template-columns: 150px 1fr; gap: 4px 10px; }
.access-box dt { color: var(--muted); font-size: 13px; }
.access-box dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.access-box code { font-size: 15px; letter-spacing: .04em; }
.send-form { margin-top: 12px; }

/* Rôles cumulables */
.roles-field { margin-bottom: 14px; }
.role-extra { display: block; color: var(--muted); font-size: 12.5px; }
.roles-field .check-card span { display: flex; flex-direction: column; line-height: 1.25; }
.roles-field .check-card small { font-size: 12px; font-weight: 400; color: var(--muted); }
.roles-field.has-error .check-card { border-color: var(--red); }
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.roles-combine { margin: 14px 0 0; }

.page-head .quick-add { margin-top: 12px; }

/* Fiche contact : budget (acheteur, locataire) ou prix souhaité / minimum (propriétaire, vendeur, bailleur) */
[data-project][data-owner="1"] .for-buyer, [data-project][data-owner="1"] .for-buyer-inline,
[data-project][data-owner="0"] .for-owner, [data-project][data-owner="0"] .for-owner-inline,
[data-project][data-rent="1"] .if-sale, [data-project][data-rent="0"] .if-rent { display: none; }
.price-pair { margin-bottom: 4px; }
.price-min { display: block; color: var(--muted); font-size: 12px; }

/* Choix en boutons (radio) : prix affiché / sur demande */
.field > .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.radio-switch { align-self: flex-start; }
.radio-switch label { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.radio-switch label:has(input:checked) { background: var(--navy-800); color: #fff; }
.radio-switch input { position: absolute; opacity: 0; pointer-events: none; }
.radio-switch label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.pcard-onreq { display: block; font-size: 11.5px; font-weight: 600; color: var(--gold-700); }
.price-mode { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Secteur recherché : wilaya + plusieurs communes */
.search-area { margin: 6px 0 4px; }
.search-area > .label { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.area-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.area-head .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.area-count { font-weight: 500; }
.area-filter { max-width: 240px; padding: 6px 10px; font-size: 13.5px; }
.area-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 10px; max-height: 260px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.area-list .muted { margin: 4px 0; grid-column: 1 / -1; }
.area-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; font-size: 14px; color: var(--ink); cursor: pointer; }
.area-item:hover { background: var(--paper); }
.area-item input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy-800); flex: none; }
.area-item:has(input:checked) { font-weight: 600; color: var(--navy-900); }
.field.has-error .area-list { border-color: var(--red); }
@media (max-width: 720px) { .area-filter { max-width: none; width: 100%; } .area-list { grid-template-columns: 1fr 1fr; } }

/* ---------- Conformité ---------- */
.compliance-tabs { margin-bottom: 18px; }
.compliance-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 18px; }
.compliance-cards .alert-line { display: block; margin: 8px 0 0; }
.compliance-legal { margin-top: 18px; max-width: 90ch; }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber); font-weight: 500; margin: 0 0 14px; }
.notice-red { background: var(--red-bg); color: var(--red); }
.notice-green { background: var(--green-bg); color: var(--green); }
.notice a { color: inherit; text-decoration: underline; }
.form-title { font-size: 17px; color: var(--navy-900); margin: 0 0 12px; }
.form-card + .form-card { margin-top: 18px; }
.link-quiet { display: inline-block; margin-top: 14px; font-size: 13.5px; color: var(--muted); text-decoration: underline; }
.kyc-company { display: none; }
[data-kyc][data-morale="1"] .kyc-company { display: grid; }
[data-kyc][data-morale="1"] div.kyc-company:not(.grid-3) { display: block; }
.kyc-panel .kyc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.kyc-panel .kyc-row:first-of-type { border-top: 0; }
.annual { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; margin-bottom: 22px; max-width: 900px; }
.annual-head { display: flex; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid var(--gold); margin-bottom: 16px; }
.annual-head .logo-mark { width: 44px; height: 44px; }
.annual-head h2 { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--navy-900); }
.annual-head p { margin: 2px 0 0; color: var(--muted); }
.annual h3 { font-size: 15px; color: var(--navy-900); margin: 22px 0 8px; }
.annual .table td:first-child { color: var(--ink-2); }
.annual-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
.annual-sign span { border-top: 1px solid var(--line-strong); padding-top: 8px; font-size: 13px; color: var(--muted); min-height: 70px; }
@media print {
  .no-print, .compliance-tabs, .flash { display: none !important; }
  .annual { border: 0; padding: 0; max-width: none; break-after: page; }
}

/* ---------- Messagerie ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 150px); min-height: 480px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-list { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.chat-list-head .page-title { font-size: 24px; margin-bottom: 10px; }
.chat-new select { width: 100%; }
.chat-items { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.chat-item:hover { background: var(--paper); color: var(--ink); }
.chat-item.is-active { background: var(--navy-50); box-shadow: inset 3px 0 0 var(--gold); }
[dir="rtl"] .chat-item.is-active { box-shadow: inset -3px 0 0 var(--gold); }
.chat-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-900); font-weight: 700; }
.chat-avatar-agency { background: var(--navy-900); color: var(--gold-300); }
.chat-avatar-client { background: var(--gold-100, #F5EBD8); color: var(--gold-700); }
.chat-avatar .ic { width: 18px; height: 18px; }
.chat-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-item-text strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.has-unread .chat-item-text small { color: var(--ink); font-weight: 600; }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.chat-item-meta small { color: var(--muted); font-size: 11.5px; }
.chat-thread { display: flex; flex-direction: column; min-height: 0; background: var(--paper); }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-head h2 { font-size: 17px; color: var(--navy-900); }
.chat-head p { margin: 2px 0 0; font-size: 13px; }
.chat-back { display: none; font-size: 28px; line-height: 1; color: var(--navy-900); padding: 0 6px; }
.chat-thread .notice { margin: 12px 20px 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.chat-hint { text-align: center; margin: auto 0; }
.msg { max-width: min(560px, 80%); align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; border-end-start-radius: 4px; padding: 9px 13px; }
.msg-mine { align-self: flex-end; background: var(--navy-900); border-color: var(--navy-900); color: #fff; border-end-start-radius: 14px; border-end-end-radius: 4px; }
.msg-client { border-color: var(--gold-300); background: #FFFBF3; }
.msg-author { display: block; font-size: 12px; font-weight: 700; color: var(--navy-700, var(--navy-900)); margin-bottom: 2px; }
.msg-body { margin: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
.msg-time { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; text-align: end; }
.msg-mine .msg-time { color: #AFC0DD; }
.chat-compose { display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.chat-compose textarea { flex: 1; resize: none; max-height: 160px; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty .ic-lg { color: var(--navy-300, var(--muted)); }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; height: calc(100vh - 120px); }
  .chat.chat-open .chat-list { display: none; }
  .chat:not(.chat-open) .chat-thread { display: none; }
  .chat-back { display: block; }
}
.chat-portal { height: auto; min-height: 420px; grid-template-columns: 1fr; }
.chat-portal .chat-messages { max-height: 60vh; min-height: 260px; }
.chat-new select, .chat-compose textarea { width: 100%; font: inherit; font-size: 14.5px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.chat-compose textarea { line-height: 1.4; }
.chat-compose textarea:focus, .chat-new select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
@media (max-width: 860px) { .chat-compose textarea::placeholder { font-size: 13px; } }

/* Annonces et statistiques d'un bien */
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.mini-stats div { background: var(--paper); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; }
.mini-stats strong { font-family: var(--display); font-size: 22px; color: var(--navy-900); font-weight: 400; }
.mini-stats span { font-size: 12.5px; color: var(--muted); }
.add-ad { margin-top: 10px; }
.add-ad summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--navy-800); }
.add-ad form { margin-top: 10px; }
.mini-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.text-red { color: var(--red) !important; }
.rent-pay { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.rent-pay select { font-size: 12.5px; padding: 3px 4px; border: 1px solid var(--line-strong); border-radius: 6px; max-width: 86px; }

/* ---------- Espace propriétaire : suivi ---------- */
.section-title { font-size: 18px; color: var(--navy-900); margin: 22px 0 12px; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.alert-item:first-child { border-top: 0; }
.alert-item.is-new .alert-text a, .alert-item.is-new .alert-text strong { font-weight: 700; }
.alert-item.is-new .alert-icon { background: var(--gold); color: #fff; }
.alert-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-50); color: var(--navy-800); display: grid; place-items: center; }
.alert-icon .ic { width: 17px; height: 17px; }
.alert-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-text small { color: var(--muted); }
.alert-item time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.owner-props { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.owner-prop { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.owner-prop:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(15,33,64,.08); }
.owner-prop-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.owner-prop-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.owner-prop-stats strong { color: var(--navy-900); font-size: 15px; }
.owner-prop-link { font-size: 13.5px; font-weight: 600; color: var(--gold-700); }
.steps { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: s; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.steps li::before { content: ""; position: absolute; top: 13px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--line-strong); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.is-done::before { background: var(--gold); }
.step-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; display: grid; place-items: center; }
.steps li.is-done .step-dot { background: var(--navy-900); border-color: var(--navy-900); color: var(--gold-300); }
.step-dot .ic { width: 15px; height: 15px; }
.step-label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; }
.step-label small { font-weight: 400; color: var(--muted); }
.steps li:not(.is-done) .step-label { color: var(--muted); font-weight: 500; }
.steps-mini { margin: 2px 0; gap: 4px; }
.steps-mini li::before { top: 4px; }
.steps-mini span { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; position: relative; z-index: 1; }
.steps-mini li.is-done span { background: var(--gold); border-color: var(--gold); }
.owner-stats { grid-template-columns: repeat(3, 1fr); }
.views-chart { margin: 14px 0 0; }
.views-chart svg { width: 100%; height: 90px; display: block; }
.views-chart .bar { fill: var(--navy-800); }
.views-chart .bar-zero { fill: var(--line-strong); }
.views-chart figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.interest-line { margin: 12px 0 0; }
.visit-list { list-style: none; margin: 0; padding: 0; }
.visit-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.visit-list li:first-child { border-top: 0; }
.visit-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.visit-list p { margin: 4px 0 0; }
.visit-report { margin-top: 8px; padding: 10px 12px; border-inline-start: 3px solid var(--gold); background: var(--paper); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
@media (max-width: 720px) {
  .owner-stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { flex-direction: row; text-align: start; padding: 6px 0; }
  .steps li::before { top: -50%; inset-inline-start: 13px; width: 2px; height: 100%; }
  .alert-item { grid-template-columns: 34px 1fr; }
  .alert-item time { grid-column: 2; }
}

/* ---------- Espace client : navigation, actions, offres, prix, créneaux, documents ---------- */
.portal-nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.portal-nav-in { max-width: 1040px; margin: 0 auto; padding: 0 clamp(8px, 3vw, 32px); display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.portal-nav a, .portal-nav button { display: inline-flex; align-items: center; gap: 7px; padding: 13px 12px 11px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: none; font-family: inherit; cursor: pointer; }
.portal-nav a:hover, .portal-nav button:hover { color: var(--navy-900); }
.portal-nav a[aria-current="page"] { color: var(--navy-900); border-bottom-color: var(--gold); font-weight: 600; }
.portal-nav .ic { width: 17px; height: 17px; }
.portal-nav .pwa-install { margin-inline-start: auto; color: var(--gold-700); font-weight: 600; }
.panel-gold { border-color: var(--gold-300); background: linear-gradient(180deg, var(--gold-100), #fff 60%); }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list a { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(184,145,74,.25); color: var(--ink); font-weight: 500; }
.todo-list li:first-child a { border-top: 0; }
.todo-list .ic { color: var(--gold-700); }
.offer-list { list-style: none; margin: 0; padding: 0; }
.offer-list > li { padding: 14px 0; border-top: 1px solid var(--line); }
.offer-list > li:first-child { border-top: 0; padding-top: 4px; }
.offer-list > li.is-open { background: var(--paper); margin: 0 -14px; padding: 14px; border-radius: var(--radius-sm); border-top-color: transparent; }
.offer-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.offer-amount { font-family: 'Marcellus', serif; font-size: 22px; color: var(--navy-900); font-weight: 400; }
.offer-list p { margin: 6px 0 0; }
.owner-answer { font-size: 13.5px; color: var(--ink-2); padding: 7px 10px; background: var(--paper); border-inline-start: 3px solid var(--gold); border-radius: 0 6px 6px 0; margin: 8px 0 0; }
.offer-answer { margin-top: 12px; }
.offer-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.counter summary, .add-ad summary, .incident-actions summary { cursor: pointer; color: var(--gold-700); font-weight: 600; font-size: 14px; }
.counter .inline-form { margin-top: 8px; }
.price-advice { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 4px 0 12px; }
.price-advice div { display: flex; flex-direction: column; }
.price-advice strong { font-family: 'Marcellus', serif; font-size: 26px; font-weight: 400; color: var(--navy-900); }
.price-advice .strike { text-decoration: line-through; color: var(--muted); font-size: 20px; }
.price-advice .arrow { font-size: 22px; color: var(--gold); }
[dir="rtl"] .price-advice .arrow { transform: scaleX(-1); }
.table caption { text-align: start; padding: 6px 2px; }
.steps-6 { grid-template-columns: repeat(6, 1fr); }
.slot-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.slot-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.slot-row select, .slot-row input { font: inherit; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.slot-row select { min-width: 140px; }
.thumb-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb-row img { width: 86px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; color: var(--ink-2); }
.incident-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.incident-actions details { flex-basis: 100%; }
.incident-actions form.stack { margin-top: 8px; }
.inspection { padding: 10px 0; border-top: 1px solid var(--line); }
.inspection:first-of-type { border-top: 0; }
.inspection h3 { font-size: 15px; margin: 0 0 4px; color: var(--navy-900); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inspection p { margin: 4px 0; }
.request-list { list-style: none; margin: 0; padding: 0; }
.request-list li { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid rgba(184,145,74,.25); }
.request-list li:first-child { border-top: 0; }
.request-list .upload-row { margin: 0; flex: 1 1 280px; justify-content: flex-end; }
.vault a { display: flex; align-items: center; gap: 10px; color: var(--ink); width: 100%; }
.vault a span { display: flex; flex-direction: column; }
.vault small { color: var(--muted); }
.cta-panel { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cta-panel h2 { margin: 0 0 4px; font-size: 17px; color: var(--navy-900); }
.cta-panel p { margin: 0; }
.install-help { margin: 8px 0 0; padding-inline-start: 18px; }
.pref-list { list-style: none; margin: 0 0 10px; padding: 0; }
.pref-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.pref-list li:first-child { border-top: 0; }
.pref-list label { display: flex; gap: 8px; align-items: center; }
.want-switch { margin-bottom: 14px; }
.want-switch label { padding: 6px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.want-switch label:has(input:checked) { background: var(--navy-800); color: #fff; }
.rent-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.mgmt-form input { width: 64px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; }
.share-form select { font-size: 12px; padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 6px; max-width: 130px; }
.files li .badge { flex: none; }
.doc-requests .nowrap { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cred-box { background: var(--gold-100); border: 1px solid var(--gold-300); border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0; }
.cred-box p { margin: 2px 0; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }
@media (max-width: 720px) {
  .steps-6 { grid-template-columns: 1fr; }
  .portal-nav span { font-size: 13px; }
  .request-list .upload-row { justify-content: flex-start; }
}
@media print {
  .portal-top, .portal-nav, .no-print, [data-print], .flash { display: none !important; }
  .portal-main { padding: 0; max-width: none; }
  .panel { break-inside: avoid; box-shadow: none; }
}
.want-switch input { position: absolute; opacity: 0; pointer-events: none; }
.want-switch label:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
@media (max-width: 560px) { .hide-sm { display: none; } .mini-stats strong { font-size: 19px; } .table-compact td, .table-compact th { padding-inline: 6px; } }
/* Document imprimable (démonstration : quittance, relevé) */
.paper-doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px clamp(18px, 4vw, 40px); box-shadow: var(--shadow); }
.paper-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--gold); padding-bottom: 14px; margin-bottom: 16px; }
.paper-brand { display: flex; gap: 12px; align-items: flex-start; }
.paper-brand .logo-mark { width: 44px; height: 44px; }
.paper-brand strong { font-family: 'Marcellus', serif; font-size: 20px; color: var(--navy-900); display: block; }
.paper-brand small, .paper-title small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.paper-title { text-align: end; }
.paper-title h1 { margin: 0 0 4px; font-size: 18px; color: var(--navy-900); }
.paper-text { margin: 18px 0; line-height: 1.6; }
.paper-sign { margin-inline-start: auto; width: 240px; height: 90px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.table tr.total td { border-top: 2px solid var(--gold); }

/* ---------- Logo IMMODZ officiel ---------- */
.logo-full { display: block; height: auto; max-width: 100%; }
.brand-logo { width: 176px; }
.brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.brand .brand-sub { padding-inline-start: 2px; }
.brand-portal { flex-direction: row; align-items: center; gap: 14px; }
.brand-portal .brand-logo { width: 150px; }
.brand-portal .brand-sub { border-inline-start: 1px solid rgba(255,255,255,.25); padding-inline-start: 14px; }
.login-logo { width: 220px; height: auto; display: block; margin-bottom: 22px; }
.annual-logo { width: 170px; }
.paper-brand .logo-mark { width: 40px; height: 44px; }
@media (max-width: 520px) { .brand-portal .brand-logo { width: 118px; } .brand-portal .brand-sub { display: none; } }

/* ---------- Proforma ---------- */
.pf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.pf-preview { position: sticky; top: 16px; }
.pf-lines td, .pf-lines th { padding: 7px 4px; }
.pf-lines .pf-group th { font-size: 12px; font-weight: 600; color: var(--gold-700); padding-top: 12px; border-bottom: 0; text-align: start; }
.pf-lines .pf-base td { font-weight: 600; }
.pf-lines .pf-deduct td.num { color: var(--red, #B42318); }
.pf-lines tfoot th { text-align: start; font-size: 15px; color: var(--navy-900); border-top: 2px solid var(--gold); padding-top: 10px; }
.pf-lines tfoot td { border-top: 2px solid var(--gold); padding-top: 10px; font-size: 17px; color: var(--navy-900); }
.pf-op, .pf-party { margin-bottom: 12px; }
.pf-op label, .pf-party label { padding: 7px 14px; border-radius: 6px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.pf-op label:has(input:checked), .pf-party label:has(input:checked) { background: var(--navy-800); color: #fff; }
.pf-op input, .pf-party input { position: absolute; opacity: 0; pointer-events: none; }
.pf-op label:focus-within, .pf-party label:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.pf-party label[hidden] { display: none; }
.stack-buttons { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 980px) { .pf-layout { grid-template-columns: 1fr; } .pf-preview { position: static; } }
.pf-lines { width: 100%; table-layout: fixed; min-width: 0; }
.pf-lines td.num, .pf-lines tfoot td { width: 38%; white-space: nowrap; }
.pf-preview { overflow: hidden; }
.paper-logo, .md-logo { width: 190px; height: auto; display: block; margin-bottom: 6px; }
.pf-lines tfoot th { white-space: normal; }
.pf-lines tfoot td { font-size: 16px; }

/* ---------- Prix du marché ---------- */
.market-op { display: inline-flex; }
.market-op a { padding: 7px 14px; border-radius: 6px; font-size: 14px; color: var(--ink-2); }
.market-op a[aria-current="page"] { background: var(--navy-800); color: #fff; }
.market-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.trend-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 190px; padding-top: 10px; }
.trend-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.trend-col svg { width: 100%; height: 120px; display: block; }
.trend-col rect { fill: var(--navy-800); }
.trend-col:last-child rect { fill: var(--gold); }
.trend-val { font-size: 11.5px; font-weight: 600; color: var(--navy-900); }
.trend-lab { font-size: 11px; color: var(--muted); white-space: nowrap; }
.trend-col small { font-size: 10.5px; color: var(--muted); }
.seg-links { display: flex; gap: 4px; flex-wrap: wrap; }
.seg-links a { font-size: 13px; padding: 4px 10px; border-radius: 999px; color: var(--ink-2); }
.seg-links a[aria-current="page"] { background: var(--navy-50); color: var(--navy-900); font-weight: 600; }
.estimate-value { font-family: 'Marcellus', serif; font-size: 32px; color: var(--navy-900); margin: 4px 0 2px; }
.estimate-value small { font-size: 16px; color: var(--muted); }
.estimate-range { color: var(--ink-2); margin: 0 0 12px; }
.estimate-card .btn-block { margin-top: 8px; }
.market-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; background: var(--paper); border-radius: var(--radius-sm); padding: 8px 12px; margin: 10px 0; }
.market-line .ic { width: 16px; height: 16px; color: var(--gold-700); flex: none; }
.market-line span { flex: 1 1 260px; }
.market-grid td.num, #prix td.num { white-space: nowrap; }
.market-scope { margin: 0 0 8px; }
@media (max-width: 980px) { .market-grid { grid-template-columns: 1fr; } }

/* Équipements du bien */
.checks-compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.checks-compact .check-card { padding-top: 7px; padding-bottom: 7px; font-size: 13.5px; }
.feature-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feature-tags li { background: var(--paper); border-radius: 999px; padding: 4px 11px; font-size: 13px; color: var(--ink-2); }

/* Clés */
.keys-panel .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.keys-panel .panel-head h2 .ic { width: 18px; height: 18px; color: var(--gold-700); }
.keys-panel { border-left: 4px solid var(--amber, #D97706); }
.keys-panel.keys-bureau { border-left-color: var(--green); }
.keys-panel.keys-out { border-left-color: var(--red); }
.keys-panel.keys-tiers { border-left-color: var(--blue); }
.keys-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.keys-more { margin-top: 10px; border-top: 1px dashed var(--line-strong); padding-top: 8px; }
.keys-more summary { cursor: pointer; font-weight: 600; color: var(--navy-800); font-size: 14px; }
.keys-more form { margin-top: 10px; }
.keys-log { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.keys-log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.keys-log-date { color: var(--muted); margin-right: 6px; }
.badge-key { display: inline-flex; align-items: center; gap: 4px; }
.badge-key .ic { width: 12px; height: 12px; }
.keys-line { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin: 6px 0; }
.keys-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.keys-form .field { margin-bottom: 10px; }

/* Bon de visite : signature sur l'écran */
.voucher-engagement { background: var(--paper); border-radius: var(--radius-sm); padding: 10px 12px; margin: 4px 0 12px; font-size: 13.5px; }
.voucher-engagement p { margin: 0 0 8px; }
.sig-pad { position: relative; border: 2px dashed var(--line-strong); border-radius: 10px; background: #fff; margin-bottom: 12px; }
.sig-pad canvas { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; border-radius: 8px; }
.sig-pad .sig-hint { position: absolute; left: 12px; bottom: 8px; font-size: 12px; color: var(--muted); pointer-events: none; }
.sig-pad.is-signed .sig-hint { display: none; }
.sig-pad .sig-clear { position: absolute; right: 8px; top: 8px; }
.sig-pad.has-error { border-color: var(--red); }
.voucher-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sig-preview { display: block; max-width: 320px; width: 100%; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 10px; background: #fff; }

/* ---------- Signature du mandat à distance ---------- */
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
details > summary.link-btn { list-style: none; display: inline-block; margin-top: 12px; }
details > summary.link-btn::-webkit-details-marker { display: none; }
.sign-panel .doc-actions { margin: 10px 0 6px; }
.sign-steps { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 8px; counter-reset: st; }
.sign-steps li { counter-increment: st; position: relative; padding-inline-start: 34px; min-height: 24px; line-height: 24px; font-size: 14px; }
.sign-steps li::before { content: counter(st); position: absolute; inset-inline-start: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line-strong); text-align: center; font-size: 12px; font-weight: 700; }
.sign-steps li.is-done::before { content: '✓'; background: var(--green-bg, #e7f4ec); border-color: transparent; color: var(--green, #1d7a46); }
.sign-page { max-width: 560px; margin: 0 auto; padding: 18px 0 40px; }
.sign-head { margin: 6px 0 16px; }
.sign-head .page-title { font-size: 25px; line-height: 1.25; margin: 2px 0 8px; }
.sign-agency { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.sign-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.sign-card h2 { font-size: 18px; margin: 0 0 12px; }
.sign-card h2 small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.sign-facts { margin: 0 0 14px; display: grid; gap: 0; }
.sign-facts > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sign-facts > div:first-child { border-top: 0; padding-top: 0; }
.sign-facts dt { color: var(--muted); font-size: 13.5px; }
.sign-facts dd { margin: 0; font-weight: 600; }
.sign-facts dd small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.sign-facts .sign-scope { font-weight: 500; font-size: 14px; line-height: 1.45; }
.sign-form .check.sign-approve { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--paper); border-radius: 10px; margin: 4px 0 12px; font-weight: 600; line-height: 1.4; }
.sign-form .check.sign-approve input { width: 22px; height: 22px; flex: none; margin: 0; }
.sign-form .check.sign-approve.has-error { outline: 2px solid var(--red); }
.sign-form .sig-pad canvas { aspect-ratio: 5 / 2; }
.btn-lg { min-height: 52px; font-size: 16.5px; }
.sign-help { text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.sign-done { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 20px; text-align: center; box-shadow: var(--shadow); }
.sign-done-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg, #e7f4ec); color: var(--green, #1d7a46); }
.sign-done-ic svg { width: 30px; height: 30px; }
.sig-preview-c { margin-inline: auto; }
@media (max-width: 420px) { .sign-facts > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Comptes-rendus de la semaine aux propriétaires ---------- */
.digest-count { font-weight: 600; margin: 0 0 14px; }
.digest-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); align-items: start; }
.digest { padding: 18px; }
.digest.is-due { border-color: var(--amber); }
.digest-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.digest-head h2 { font-size: 16px; margin: 0 0 2px; }
.digest-head h2 .muted { font-weight: 500; font-size: 14px; }
.digest-head p { margin: 0; font-size: 13.5px; }
.digest-figs { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.digest-figs li { background: var(--paper); border-radius: 10px; padding: 8px 4px; text-align: center; }
.digest-figs strong { display: block; font-size: 19px; line-height: 1.1; }
.digest-figs span { font-size: 12px; color: var(--muted); }
.digest-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.digest textarea { width: 100%; font: inherit; font-size: 14px; line-height: 1.5; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; resize: vertical; background: #fff; }
.digest-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.digest-actions small { flex: 1 1 220px; }
.digest-done { margin-top: 22px; }
.digest-done > summary { cursor: pointer; font-weight: 600; margin-bottom: 14px; }
.digest-cta p { margin: 0 0 12px; }

/* ---------- Rapport de prix ---------- */
.pr-diag { margin-bottom: 10px; }
.pr-verdict { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px; }
.pr-verdict strong { font-size: 18px; }
.pr-gauge { display: block; width: 100%; height: auto; max-height: 110px; margin: 6px 0 2px; overflow: visible; }
.pr-gauge .g-track { fill: #E8ECF3; }
.pr-gauge .g-range { fill: #C4DECD; }
.pr-gauge .g-med { stroke: var(--green); stroke-width: 3; }
.pr-gauge .g-price { fill: var(--navy-900); }
.pr-gauge .g-sugg { fill: var(--gold); }
.pr-gauge text { font-size: 22px; font-weight: 600; }
.pr-gauge .g-tmed { fill: var(--green); }
.pr-gauge .g-tprice { fill: var(--navy-900); }
.pr-gauge .g-tsugg { fill: var(--gold-700); }
.pr-facts { margin: 10px 0 12px; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; }
.pr-facts .is-warn { color: var(--amber); font-weight: 600; }
.pr-more { margin: 10px 0; }
.pr-more > summary { cursor: pointer; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.pr-legend { list-style: none; margin: 4px 0 2px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.pr-legend li { display: flex; align-items: center; gap: 6px; }
.pr-legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pr-legend strong { color: var(--ink); font-weight: 600; }
.pr-legend .l-price::before { background: var(--navy-900); }
.pr-legend .l-sugg::before { background: var(--gold); }
.pr-legend .l-med::before { background: var(--green); width: 4px; }
.pr-legend .l-range::before { background: #C4DECD; }
.pr-gauge .g-med { fill: var(--green); }

/* ---------- Diffusion sur les réseaux ---------- */
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.df-covers { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.df-covers figure { margin: 0; width: min(100%, 340px); }
.df-covers figure.is-story { width: min(100%, 200px); }
.df-covers img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.df-covers figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.df-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); align-items: start; margin-top: 16px; }
.df-card { padding: 18px; border-top: 4px solid var(--line-strong); }
.df-fb { border-top-color: #1877F2; } .df-ok { border-top-color: #00A3E0; } .df-ig { border-top-color: #D62976; } .df-tt { border-top-color: #111; } .df-wa { border-top-color: #25D366; }
.df-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.df-head h2 { font-size: 17px; margin: 0; }
.df-head .df-stat { font-size: 12.5px; color: var(--muted); flex: 1; }
.df-card textarea, .df-card input[type=text] { width: 100%; font: inherit; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; background: #fff; }
.df-card textarea { resize: vertical; }
.df-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.df-actions code { font-size: 12px; background: var(--paper); padding: 3px 6px; border-radius: 6px; word-break: break-all; }
.df-fields { margin: 0 0 12px; display: grid; gap: 0; font-size: 13.5px; }
.df-fields > div { display: grid; grid-template-columns: 9em 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); align-items: center; }
.df-fields dt { color: var(--muted); }
.df-fields dd { margin: 0; display: flex; gap: 8px; align-items: center; justify-content: space-between; font-weight: 600; }
.df-h3 { font-size: 14px; margin: 8px 0 6px; }
.df-plan { margin: 0 0 8px; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.df-pub { border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.df-pub-ok { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; font-size: 13.5px; color: var(--green); }
.df-pub-ok svg { width: 16px; height: 16px; }
.df-pub-form { display: flex; gap: 8px; }
.df-pub-form input { flex: 1; min-width: 0; font: inherit; font-size: 13px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; }
.df-table td.num, .df-table th.num { text-align: end; }
.df-table .df-best td { background: var(--green-bg); }
.df-bar { display: block; height: 6px; border-radius: 3px; background: var(--gold); margin-top: 4px; }
.df-read { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.df-prog { display: block; width: 100%; max-width: 160px; height: 6px; margin-top: 4px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--paper); overflow: hidden; }
.df-prog::-webkit-progress-bar { background: var(--paper); border-radius: 3px; }
.df-prog::-webkit-progress-value { background: var(--gold); border-radius: 3px; }
.df-prog::-moz-progress-bar { background: var(--gold); border-radius: 3px; }

/* ---------- Transactions : saisie complète (anciennes affaires) ---------- */
.tx-kind { display: inline-flex; margin: 0 0 14px; }
.tx-kind a { padding: 8px 14px; font-weight: 600; font-size: 14px; }
.tx-kind a.is-active { color: #fff; background: var(--navy-900); }
.note-info { background: #EAF1FB; color: #1E3A66; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; margin: 0 0 14px; }
.tx-choice .owner-switch { margin-bottom: 12px; }
.tx-paid { margin-top: 10px; align-items: end; }

/* ---------- Contacts depuis le téléphone ---------- */
.imp-ways { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.imp-way { padding: 20px; }
.imp-way h2 { display: flex; gap: 8px; align-items: center; font-size: 17px; margin: 0 0 8px; }
.imp-way h2 svg { width: 20px; height: 20px; }
.imp-help { margin-top: 14px; font-size: 13.5px; }
.imp-help summary { cursor: pointer; font-weight: 600; }
.imp-help p { margin: 8px 0 0; line-height: 1.5; }
.imp-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.imp-tools input[type=search] { flex: 1 1 220px; font: inherit; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; }
.imp-table tr.is-known td { color: var(--muted); }
.imp-table td:first-child { width: 36px; }
.imp-table input[type=checkbox] { width: 18px; height: 18px; }
.pick-one { margin: 0 0 12px; }
.imp-table td strong { font-weight: 600; }
.imp-table .badge { margin-inline-start: 4px; }
.imp-mail { word-break: break-all; }
.sign-alt details { border-top: 1px solid var(--line); padding: 12px 0; }
.sign-alt details:first-of-type { border-top: 0; }
.sign-alt summary { cursor: pointer; font-weight: 600; }
.sign-alt form { margin-top: 10px; }
.approve-box { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: #FFF7E6; border: 1px solid #F1D9A6; }
.approve-box p { margin: 0 0 10px; font-size: 14px; }

/* ---------- IMMODZ OWNER CONNECT (CRM) ---------- */
.oc-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.oc-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.oc-nav a svg { width: 16px; height: 16px; }
.oc-nav a[aria-current="page"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.oc-nav .oc-nav-new { margin-inline-start: auto; color: var(--ink); border-color: var(--gold); }
.oc-alerts { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.oc-alerts li a { display: block; padding: 8px 12px; border-radius: 10px; background: var(--blue-bg); color: var(--blue); font-size: 13.5px; text-decoration: none; }
.oc-alerts li.is-amber a { background: var(--amber-bg); color: var(--amber); }
.oc-alerts li.is-red a { background: var(--red-bg); color: var(--red); }
.oc-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.oc-tabs a { white-space: nowrap; padding: 9px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.oc-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
.oc-tabs .count, .oc-col .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--paper); font-size: 12px; text-align: center; }
tr.is-urgent td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.oc-scores span { display: block; font-variant-numeric: tabular-nums; }
.oc-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.oc-col { background: var(--paper); border-radius: 14px; padding: 10px; min-height: 120px; }
.oc-col h2 { font-size: 14px; margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.oc-card { display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.oc-card:hover { border-color: var(--gold); }
.oc-card.is-urgent { border-inline-start: 3px solid var(--red); }
.oc-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.oc-card .ref { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc-card-top { flex-wrap: wrap; }
.oc-card .badge { font-size: 11px; }
.oc-meter { display: grid; gap: 3px; }
.oc-meter progress, .oc-quali progress, .oc-funnel progress { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--paper); overflow: hidden; }
.oc-meter progress::-webkit-progress-bar, .oc-quali progress::-webkit-progress-bar, .oc-funnel progress::-webkit-progress-bar { background: var(--paper); }
.oc-meter progress::-webkit-progress-value, .oc-quali progress::-webkit-progress-value, .oc-funnel progress::-webkit-progress-value { background: var(--navy-900); border-radius: 3px; }
.oc-meter progress::-moz-progress-bar, .oc-quali progress::-moz-progress-bar, .oc-funnel progress::-moz-progress-bar { background: var(--navy-900); }
progress.mat::-webkit-progress-value { background: var(--gold) !important; }
progress.mat::-moz-progress-bar { background: var(--gold) !important; }
.oc-next { font-size: 12.5px; color: var(--muted); }
.oc-next.is-due { color: var(--red); font-weight: 600; }
.oc-quali { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 10px; }
.oc-quali > div { display: grid; gap: 4px; }
.oc-quali strong { font-size: 24px; line-height: 1.1; }
.oc-missing { background: var(--amber-bg); color: #6B4A00; border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.oc-est strong { font-size: 18px; }
.oc-dl { margin: 0; display: grid; }
.oc-dl > div { display: grid; grid-template-columns: 13em 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.oc-dl > div:first-child { border-top: 0; }
.oc-dl dt { color: var(--muted); }
.oc-dl dd { margin: 0; }
.oc-media { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.oc-media img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.oc-media-file { font-size: 12.5px; padding: 6px 8px; background: var(--paper); border-radius: 8px; }
.oc-edit { margin-top: 12px; }
.oc-edit form { margin-top: 12px; }
.oc-docs { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.oc-versions { margin: 6px 0 0; padding-inline-start: 18px; font-size: 13.5px; }
.oc-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.oc-timeline li { display: grid; gap: 2px; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); font-size: 14px; }
.oc-timeline li.k-proprietaire { border-color: var(--gold); }
.oc-timeline li.k-alerte, .oc-timeline li.k-automatisation { border-color: var(--amber); }
.oc-timeline li.k-statut, .oc-timeline li.k-mandat { border-color: var(--navy-900); }
.oc-wa { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
code.oc-link { font-size: 11.5px; word-break: break-all; background: var(--paper); padding: 3px 6px; border-radius: 6px; }
.oc-consent p { margin: 0 0 6px; }
.oc-mylink { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.oc-mylink img { border-radius: 8px; border: 1px solid var(--line); flex: none; }
.oc-mylink h3 { margin: 0 0 4px; font-size: 15px; }
.oc-mylink code, #campagnes code, .table code { font-size: 12px; word-break: break-all; }
.oc-camp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; align-items: end; margin-bottom: 16px; }
.oc-tpl-h { font-size: 15px; margin: 16px 0 8px; }
.oc-tpl { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.oc-tpl-item { display: grid; gap: 4px; justify-items: start; }
.oc-tpl-item textarea { width: 100%; font: inherit; font-size: 13px; line-height: 1.5; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--paper); resize: vertical; }
.oc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 16px; }
.oc-kpis > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 2px; }
.oc-kpis span { font-size: 13px; color: var(--muted); }
.oc-kpis strong { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.oc-kpis small { font-size: 12.5px; color: var(--muted); }
.oc-funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.oc-funnel li { display: grid; grid-template-columns: 12em 1fr 3em 3.5em; gap: 10px; align-items: center; font-size: 14px; }
.oc-funnel strong { text-align: end; font-variant-numeric: tabular-nums; }
.oc-consent-check { display: flex; gap: 10px; padding: 12px; background: var(--paper); border-radius: 10px; margin: 6px 0 14px; font-weight: 600; }
@media (max-width: 640px) { .oc-dl > div { grid-template-columns: 1fr; gap: 2px; } .oc-funnel li { grid-template-columns: 1fr 3em 3.5em; } .oc-funnel li progress { grid-column: 1 / -1; grid-row: 2; } .oc-nav .oc-nav-new { margin-inline-start: 0; } }
.oc-rows li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.oc-rows li:first-child { border-top: 0; }
.oc-portal { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-bg); }
.oc-portal p { margin: 0 0 8px; font-size: 14px; }
.oc-portal-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.oc-portal-row .field { flex: 1 1 240px; margin: 0; }
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 14px; }
.tr-bar .btn .ic { width: 16px; height: 16px; }
textarea.is-proposed { border-color: var(--gold, #c9a35a); background: #fffbf2; }
/* Données personnelles */
.pv-optout { background: var(--amber-bg); color: var(--amber); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; margin: 0 0 14px; }
.pv-panel { display: grid; gap: 10px; justify-items: start; }
.pv-panel form { margin: 0; }
.pv-erase summary { cursor: pointer; color: var(--red); font-weight: 600; font-size: 13.5px; }
.pv-erase form { display: grid; gap: 8px; margin-top: 8px; }
.pv-facts { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.pv-facts:last-child { border-bottom: 0; }
@media print { .no-print, .sidebar, .topbar, .app-nav { display: none !important; } .pv-export .panel { break-inside: avoid; box-shadow: none; } }
/* Site : accueil et messages */
.sc-models { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 14px; }
.sc-thumb { display: block; max-width: 260px; border-radius: 10px; margin: 4px 0 8px; }
.sc-list { display: grid; gap: 12px; }
.sc-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.sc-item img { width: 120px; height: 70px; object-fit: cover; border-radius: 8px; }
.sc-item p { margin: 4px 0 6px; }
.sc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-actions form { margin: 0; }
@media (max-width: 700px) { .sc-item { grid-template-columns: 80px 1fr; } .sc-item img { width: 80px; height: 56px; } .sc-actions { grid-column: 1 / -1; } }

/* Chiffre d'affaires (page Transactions) */
.ca-panel { padding-bottom: 14px; }
.ca-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ca-head h2 { font-size: 17px; font-weight: 700; color: var(--navy-900); margin: 0; }
.ca-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ca-title { font-size: 15.5px; color: var(--navy-900); min-width: 9em; text-align: center; }
.ca-step { min-width: 34px; justify-content: center; font-size: 18px; line-height: 1; }
.ca-step.is-off { opacity: .35; pointer-events: none; }
.ca-today { font-size: 13px; font-weight: 600; margin-inline-start: 6px; }
.ca-figures { margin-bottom: 10px; }
.ca-up { color: var(--green, #1E7A4C); font-weight: 600; }
.ca-down { color: var(--red); font-weight: 600; }
.ca-bars .bar rect.hit { fill: transparent; }
.ca-bars a .bar:hover rect:not(.hit) { fill: var(--gold); }
.ca-bars a:focus-visible { outline: none; }
.ca-bars a:focus-visible .bar rect.hit { stroke: var(--navy-800); stroke-width: 2; }
.ca-list-title { font-size: 15.5px; font-weight: 700; color: var(--navy-900); margin: 18px 0 8px; }

/* Notifications sonores : cloche, bulles */
.sound-toggle .ic-off { display: none; }
.sound-toggle.is-off .ic-on { display: none; }
.sound-toggle.is-off .ic-off { display: inline; }
.sound-toggle.is-off { color: var(--muted); }
.portal-tools .sound-toggle { flex: none; }
.nt-stack { position: fixed; inset-block-end: 18px; inset-inline-end: 18px; z-index: 900; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.nt-toast { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 40px 12px 14px; background: var(--navy-900); color: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(19, 40, 74, .28); border-inline-start: 4px solid var(--gold); text-decoration: none; animation: nt-in .25s ease-out; }
[dir="rtl"] .nt-toast { padding: 12px 14px 12px 40px; }
.nt-toast:hover { color: #fff; background: var(--navy-800); }
.nt-toast strong { font-size: 14px; font-weight: 600; }
.nt-toast span { font-size: 13px; color: #C9D3E6; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nt-close { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border: 0; background: transparent; color: #C9D3E6; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 6px; }
.nt-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
@keyframes nt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nt-toast { animation: none; } }
@media (max-width: 640px) { .nt-stack { inset-inline: 12px; inset-block-end: 12px; width: auto; } }

/* Installation de l'application (espace client) */
.pwa-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--gold-300); border-radius: var(--radius); box-shadow: var(--shadow); }
.pwa-card[hidden] { display: none; }
.pwa-card-icon img { display: block; border-radius: 10px; }
.pwa-card-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pwa-card-text strong { color: var(--navy-900); font-size: 15px; }
.pwa-card-text .muted { font-size: 13.5px; }
.pwa-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .pwa-card { flex-wrap: wrap; } .pwa-card-actions { width: 100%; } .pwa-card-actions .btn { flex: 1; justify-content: center; } }
.pwa-dialog { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(19, 40, 74, .35); color: var(--ink); }
.pwa-dialog::backdrop { background: rgba(13, 27, 52, .55); }
.pwa-dialog-in { padding: 22px 22px 18px; }
.pwa-dialog h2 { font-size: 18px; color: var(--navy-900); margin: 0 0 6px; }
.pwa-dialog h3 { font-size: 15px; color: var(--navy-900); margin: 16px 0 6px; }
.pwa-dialog ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.pwa-dialog li .ic { width: 18px; height: 18px; vertical-align: -4px; color: var(--navy-800); }
.pwa-dialog .small { font-size: 12.5px; margin-top: 8px; }
.pwa-os { display: none; }
.pwa-dialog[data-os="ios"] .pwa-os-ios, .pwa-dialog[data-os="android"] .pwa-os-android, .pwa-dialog[data-os="desktop"] .pwa-os-desktop { display: block; }
.pwa-dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* Cases invisibles des boutons de choix : 1 px, pour ne pas élargir la page (défilement de côté). */
.owner-switch input, .radio-switch input, .want-switch input, .pf-op input, .pf-party input { width: 1px; height: 1px; margin: 0; }

/* Téléphone : rien ne doit dépasser la largeur de l'écran */
.panel-head { flex-wrap: wrap; min-width: 0; }
.panel-head > * { min-width: 0; }
.mini-stats div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .trend-bars { gap: 3px; }
  .trend-lab { font-size: 9.5px; }
  .trend-val { font-size: 10px; }
}

/* Tableau dans un bloc : défilement de côté sur téléphone plutôt que toute la page */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll, .table-wrap { position: relative; }
