/* Ares Invest — Gestion locataires */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --surface-3: #e7e4dc;
  --border: #e2ded5;
  --text: #1b1a17;
  --text-2: #69655c;
  --text-3: #9a958a;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --accent-text: #ffffff;
  --green: #15803d;
  --green-soft: rgba(21, 128, 61, 0.11);
  --red: #c2410c;
  --red-strong: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.1);
  --amber: #b45309;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --shadow: 0 1px 2px rgba(20, 18, 12, 0.05), 0 4px 16px rgba(20, 18, 12, 0.05);
  --shadow-lg: 0 12px 40px rgba(20, 18, 12, 0.18);
  --radius: 10px;
  --radius-lg: 16px;
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e0e10;
    --surface: #17171a;
    --surface-2: #1f1f23;
    --surface-3: #2a2a2f;
    --border: #2c2c32;
    --text: #f2f0ea;
    --text-2: #a6a29a;
    --text-3: #6f6c66;
    --accent: #8b83ff;
    --accent-soft: rgba(139, 131, 255, 0.14);
    --accent-text: #0e0e10;
    --green: #4ade80;
    --green-soft: rgba(74, 222, 128, 0.12);
    --red: #fb923c;
    --red-strong: #f87171;
    --red-soft: rgba(248, 113, 113, 0.13);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.13);
    --shadow: none;
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0e0e10;
  --surface: #17171a;
  --surface-2: #1f1f23;
  --surface-3: #2a2a2f;
  --border: #2c2c32;
  --text: #f2f0ea;
  --text-2: #a6a29a;
  --text-3: #6f6c66;
  --accent: #8b83ff;
  --accent-soft: rgba(139, 131, 255, 0.14);
  --accent-text: #0e0e10;
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --red: #fb923c;
  --red-strong: #f87171;
  --red-soft: rgba(248, 113, 113, 0.13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.13);
  --shadow: none;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.green { color: var(--green); }
.red { color: var(--red-strong); }
.amber { color: var(--amber); }
.accent { color: var(--accent); }

/* ── Contrôles ── */
input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* évite le zoom iOS */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 46px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type='file'] { padding: 9px; }
/* iPhone : les champs date / mois / heure gardent la taille et l'alignement des autres cases */
input[type='date'], input[type='month'], input[type='time'], input[type='datetime-local'] { -webkit-appearance: none; appearance: none; display: block; box-sizing: border-box; min-width: 0; max-width: 100%; height: 46px; line-height: normal; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
label.field { min-width: 0; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 420px) { .fields { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 600;
  min-height: 44px; padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red-strong); }
.btn.danger.solid { background: var(--red-strong); border-color: var(--red-strong); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 44px; padding: 0; }
.btn.block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Écran de verrouillage ── */
.lock {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.lock-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
}
.lock-logo {
  width: 200px; height: auto; border-radius: 14px; background: #fff; padding: 6px 10px;
  display: block; margin: -8px auto 4px;
  box-shadow: 0 6px 24px rgba(15, 27, 45, 0.28);
}
.lock-head { text-align: center; }
.lock-head p { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.lock-err { color: var(--red-strong); font-size: 14px; text-align: center; min-height: 1.2em; }
.lock-foot { text-align: center; color: var(--text-3); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.lock-foot .ic { width: 14px; height: 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-wrap .btn { position: absolute; right: 1px; top: 1px; height: 44px; min-height: 44px; border: 0; background: transparent; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width 0.2s, background 0.2s; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Structure de l'application ── */
.app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-right: auto; }
.brand-mark { width: auto; height: 36px; border-radius: 6px; background: #fff; padding: 2px 4px; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0.02em; }
.sync {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 550; color: var(--text-2);
  padding: 6px 10px; border-radius: 999px; background: var(--surface-2);
  border: 0; font-family: inherit; cursor: pointer;
}
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.sync[data-s='synced'] i { background: var(--green); }
.sync[data-s='syncing'] i, .sync[data-s='pending'] i { background: var(--accent); animation: pulse 1s infinite; }
.sync[data-s='offline'] i { background: var(--amber); }
.sync[data-s='error'] i { background: var(--red-strong); }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (max-width: 480px) { .sync span { display: none; } .sync { padding: 10px; } }

.main { padding: 20px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-top: 1px solid var(--border);
}
.navbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--text-3); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.navbtn .ic { width: 23px; height: 23px; }
/* barre du bas : 9 rubriques, environ 4 et demie visibles ; on fait défiler au doigt */
.bottomnav::-webkit-scrollbar { display: none; }
.bottomnav .navbtn { flex: 0 0 21.5%; min-width: 70px; scroll-snap-align: start; position: relative; white-space: nowrap; }
.bottomnav.more-r { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
.bottomnav.more-l { -webkit-mask-image: linear-gradient(to left, #000 82%, transparent); mask-image: linear-gradient(to left, #000 82%, transparent); }
.bottomnav.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 82%, transparent); mask-image: linear-gradient(to right, transparent, #000 14%, #000 82%, transparent); }
.navbtn[aria-current='page'] { color: var(--accent); }
.sidenav { display: none; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 240px 1fr; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh; align-self: start;
    padding: 18px 12px; border-right: 1px solid var(--border); background: var(--surface);
  }
  .sidenav .brand { margin: 0 0 18px 8px; }
  .sidenav .navbtn {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    font-size: 15px; font-weight: 550; color: var(--text-2);
    padding: 10px 12px; border-radius: var(--radius);
  }
  .sidenav .navbtn:hover { background: var(--surface-2); color: var(--text); }
  .sidenav .navbtn[aria-current='page'] { background: var(--accent-soft); color: var(--accent); }
  .sidenav .spacer { flex: 1; }
  .topbar .brand { visibility: hidden; }
  .main { padding: 28px 32px 48px; }
}

/* ── Cartes & grilles ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card, .stack > * + * { margin-top: 12px; }
/* dans une grille, l'espace vient du gap : sinon la 1re carte est plus haute que ses voisines */
.grid > .card + .card { margin-top: 0; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h3 { font-size: 16px; }
.section-label { font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 24px 0 10px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.metric .lbl { font-size: 12px; font-weight: 600; color: var(--text-2); }
.metric .val { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.metric.hero { grid-column: 1 / -1; }
.metric.hero .val { font-size: 30px; }

.progress { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.progress.warn > i { background: var(--amber); }
.progress.bad > i { background: var(--red-strong); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.bad { background: var(--red-soft); color: var(--red-strong); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; }
.alert .ic { margin-top: 1px; }
.alert.bad { background: var(--red-soft); color: var(--red-strong); }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.alert b { font-weight: 650; }

/* ── Listes ── */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; min-height: 60px;
  border-bottom: 1px solid var(--border);
  background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; font: inherit; color: inherit;
}
.row:last-child { border-bottom: 0; }
button.row { cursor: pointer; }
button.row:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 14px;
}
.empty { text-align: center; padding: 36px 16px; color: var(--text-2); }
.empty .ic { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 8px; }

.search { position: relative; margin-bottom: 12px; }
.search .ic { position: absolute; left: 12px; top: 13px; color: var(--text-3); }
.search input { padding-left: 40px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select { width: auto; min-width: 110px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
/* Ordinateur : pas de glissement au doigt → les boutons des immeubles vont à la ligne au lieu de disparaître à droite */
@media (min-width: 720px), (pointer: fine) {
  .chips { flex-wrap: wrap; overflow-x: visible; }
  .toolbar .chips { flex: 1 1 100%; }
}
.pay-chips { flex: 1; min-width: 0; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 14px; font-weight: 550; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Grille des paiements ── */
.pay-tenant { padding: 14px 0; border-top: 1px solid var(--border); }
.pay-tenant:first-of-type { border-top: 0; padding-top: 4px; }
.pay-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pay-head .name { font-weight: 650; }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
@media (min-width: 720px) { .months { grid-template-columns: repeat(12, 1fr); } }
.mcell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 48px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3);
  font: inherit; font-size: 12px; font-weight: 650; cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}
.mcell:active { transform: scale(0.94); }
.mcell small { font-size: 11px; font-weight: 600; }
.mcell.paid { background: var(--green-soft); border-color: transparent; color: var(--green); }
.mcell.part { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.mcell.late { background: var(--red-soft); border-color: transparent; color: var(--red-strong); }
.mcell.now { box-shadow: inset 0 0 0 2px var(--accent); }
.mcell.off { opacity: 0.35; }
.pay-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 8px; flex-wrap: wrap; }

.totals { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius); font-size: 14px; margin-top: 12px; }
.totals b { font-variant-numeric: tabular-nums; }

/* ── Graphique ── */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 8px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar .track { width: 100%; max-width: 28px; flex: 1; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar .fill { width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; }
.bar .fill.full { background: var(--green); }
.bar small { font-size: 11px; color: var(--text-3); font-weight: 600; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Feuilles (dialogues) ── */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%;
  max-height: 92dvh;
  background: var(--surface); color: var(--text);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog.sheet::backdrop { background: rgba(10, 10, 12, 0.5); backdrop-filter: blur(2px); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 720px) {
  dialog.sheet { margin: auto; max-width: 620px; border-radius: 22px; max-height: 88dvh; }
  dialog.sheet.narrow { max-width: 440px; }
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { flex: 1; font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* min-height: 0 : sans lui, le contenu d'une longue fiche dépasse de la fenêtre et ne défile pas */
.sheet-body { padding: 18px 20px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.ghost { flex: 0 0 auto; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 16px; overflow-x: auto; }
.tab { flex: 1; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs-wrap { flex-wrap: wrap; overflow-x: visible; } /* fiches : toutes les rubriques restent visibles sur téléphone (📱 App ne se cache plus à droite) */

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 15px; }
.kv dt { color: var(--text-2); font-size: 14px; }
.kv dd { font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.actions .btn { flex: 1; min-width: 0; }
/* fiche locataire : Relancer · Réviser le loyer · Prolonger — chaque bouton garde la place de son texte, la ligne passe à la ligne si besoin */
.loc-acts .btn { flex: 1 1 auto; min-width: fit-content; }
/* Maintenance › Équipe : libellés longs → le texte passe sur deux lignes dans le bouton plutôt que de déborder */
.acts-fit .btn { flex: 1 1 auto; min-width: 0; white-space: normal; height: auto; min-height: 44px; line-height: 1.2; padding-top: 8px; padding-bottom: 8px; text-align: center; }
@media (max-width: 700px) { .acts-fit { display: grid; grid-template-columns: 1fr 1fr; } .acts-fit .btn.primary { grid-column: 1 / -1; } }
.note { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: var(--radius); font-size: 14px; }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 25;
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--accent); color: var(--accent-text);
  box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: pointer;
}
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
@media (min-width: 960px) { .fab { display: none; } }
.desk-only { display: none; }
@media (min-width: 960px) { .desk-only { display: inline-flex; } }

/* ── Toasts ── */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg); max-width: 480px; animation: sheet-up 0.2s; }
.toast button { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; filter: brightness(1.4); }
.toast.bad { background: var(--red-strong); color: #fff; }
/* les messages passent devant les fiches ouvertes (couche du dessus) */
.toasts[popover] { inset: auto 0 calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)) 0; margin: 0; border: 0; padding: 0 16px; background: transparent; overflow: visible; width: auto; height: auto; color: inherit; }
@media (min-width: 960px) { .toasts[popover] { bottom: 24px; } }
.toast { cursor: pointer; font-size: 15px; }
.toast.bad { font-weight: 700; box-shadow: 0 8px 30px rgba(185, 28, 28, 0.35); }

.settings .row { min-height: 56px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; min-height: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-3); transition: background 0.2s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform 0.2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }

@media print {
  .topbar, .bottomnav, .sidenav, .fab, .toolbar, .toasts, .btn { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
  .main { padding: 0; max-width: none; }
  .card, .list, .metric { box-shadow: none; break-inside: avoid; }
}

/* ── Rapports imprimables ── */
#print { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm 12mm; }
  body.printing > *:not(#print) { display: none !important; }
  body.printing #print { display: block !important; color: #111; font-size: 10.5px; line-height: 1.35; }
  #print .pr-head { display: flex; justify-content: space-between; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 14px; font-size: 10px; }
  #print h1 { font-size: 18px; margin: 0 0 2px; }
  #print .pr-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 10.5px; }
  #print .pr-table td, #print .pr-table th { border: 1px solid #ccc; padding: 4px 6px; text-align: left; }
  #print .pr-table th { background: #f2f2f2; }
  #print h3 { font-size: 12px; margin: 12px 0 4px; }
  #print h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 6px; color: #444; }
  #print .pr-sub { color: #555; margin-bottom: 6px; }
  #print .pr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  #print .pr-page { break-before: page; }
  #print table.tbl { width: 100%; border-collapse: collapse; font-size: 10px; break-inside: auto; }
  #print .tbl th, #print .tbl td { border: 1px solid #bbb; padding: 3px 5px; color: #111; }
  #print .tbl th { background: #f0f0f0; font-size: 9px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print .tbl tr { break-inside: avoid; }
  #print .pr-card { break-inside: avoid; margin: 0 0 10px; }
  #print .pr-card-h { font-size: 11.5px; margin: 0 0 3px; }
  #print .pr-bar { display: inline-block; height: 8px; background: #E8723A; border-radius: 2px; vertical-align: middle; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print .pr-grid td.c, #print .pr-grid th { text-align: center; padding: 3px 2px; }
  #print .r { text-align: right; }
  #print .green { color: #0a6b2e; } #print .red { color: #b91c1c; } #print .accent { color: #111; }
}

/* Photos d'état des lieux */
.edl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.edl { margin: 0; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.edl-img { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; }
.edl-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edl figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 4px 10px; font-size: 12px; color: var(--text-2); }
.edl.missing .edl-img::after { content: 'Photo indisponible hors ligne'; display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--text-3); }
.edl-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.edl-room { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.edl-room-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; font-size: 14px; }
.edl-acts { display: flex; gap: 4px; }
.edl-pair { display: grid; gap: 6px; }
.edl-pair.two { grid-template-columns: 1fr 1fr; }
.edl-grid.sm { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.edl.empty .edl-img { display: grid; place-items: center; cursor: default; font-size: 12px; color: var(--text-3); text-align: center; padding: 6px; }
.edl.out { outline: 2px solid var(--amber); }

/* Maintenance */
.dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.qr svg { display: block; width: 100%; height: auto; }
/* Feu tricolore (urgence) et légende de la maintenance */
.light { display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.row > .light { margin-top: 3px; }
.light-green { background: #16a34a; }
.light-yellow { background: #f59e0b; }
.light-red { background: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .18); }
.dot.inline { display: inline-block; width: 10px; height: 10px; vertical-align: middle; }
.legend { font-size: 13px; color: var(--text-2); display: grid; gap: 8px; padding: 12px 14px; }
.legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.legend-row .light { width: 12px; height: 12px; flex-basis: 12px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }

/* Aperçu d'un document (photo / PDF) */
dialog.pv { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .88); }
dialog.pv[open] { display: flex; flex-direction: column; }
dialog.pv::backdrop { background: rgba(0, 0, 0, .5); }
.pv-bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--surface, #fff); color: var(--text, #1d1b16); }
.pv-bar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog.pv img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
dialog.pv iframe { flex: 1; border: 0; width: 100%; background: #fff; }

/* Messages de la maison (mini-chat des habitants) */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; padding: 10px; background: var(--surface-2); border-radius: 14px; margin-bottom: 8px; }
.bub { max-width: 88%; align-self: flex-start; background: var(--surface, #fff); border-radius: 14px 14px 14px 4px; padding: 8px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bub.mgr { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--accent-soft); }
.bub-h { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.bub-h b { color: var(--text); }
.bub-del { margin-left: auto; border: 0; background: none; color: var(--red); cursor: pointer; padding: 2px; }
.bub-del .ic { width: 15px; height: 15px; }
.bub-x { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; }

/* Horaire habituel d'une personne (fiche équipe) */
.hor-grid { display: grid; grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 8px; align-items: center; margin: 8px 0; }
.hor-week { display: flex; flex-direction: column; gap: 6px; }
.hor-blk { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.hor-blk > summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hor-blk > summary .meta { font-size: 12px; color: var(--text-2); }
.hor-p { font-size: 12px; font-weight: 600; white-space: nowrap; }
.hor-row { display: contents; }
.hor-n { color: var(--text-2); font-weight: 500; }
.hor-adds { display: flex; flex-wrap: wrap; gap: 6px; }
.hor-grid input, .hor-grid select { min-width: 0; width: 100%; font: inherit; font-size: 14px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; }
@media (max-width: 480px) { .hor-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .hor-grid .hor-p { grid-column: 1 / 3; margin-top: 4px; } .hor-grid select { grid-column: 1 / 3; } }

/* Cartes repliables de l'accueil : un clic ouvre / ferme ; ouvertes, lumière chaude et douce qui respire */
details.dfold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding-right: 28px; position: relative; }
details.dfold > summary::-webkit-details-marker { display: none; }
details.dfold > summary::after { content: '›'; position: absolute; right: 4px; top: -4px; font-size: 26px; color: var(--text-3); transition: transform .25s; }
details.dfold[open] > summary::after { transform: rotate(90deg); }
details.dfold > summary h3 { font-size: 16px; margin: 0; }
details.dfold > summary .sum { flex-basis: 100%; font-size: 14px; color: var(--text-2); }
details.dfold[open] > summary .sum { display: none; }
details.dfold .dfold-body { margin-top: 12px; }
details.dfold[open] { animation: aresWarm 2.8s ease-in-out infinite; box-shadow: 0 0 0 1.5px rgba(245, 158, 11, .45), 0 0 16px 2px rgba(251, 191, 36, .28); }
@keyframes aresWarm { 0%, 100% { box-shadow: 0 0 0 1.5px rgba(245, 158, 11, .40), 0 0 12px 1px rgba(251, 191, 36, .22); } 50% { box-shadow: 0 0 0 2px rgba(245, 158, 11, .60), 0 0 24px 5px rgba(251, 191, 36, .38); } }
@media (prefers-reduced-motion: reduce) { details.dfold[open] { animation: none; } }

/* Comptabilité : tableau du journal */
.tbl .nowrap, .tbl .r { white-space: nowrap; }
.tbl td { vertical-align: top; }
.pr-tbl { width: 100%; border-collapse: collapse; font-size: 10pt; }
.pr-tbl th, .pr-tbl td { border-bottom: 1px solid #ccc; padding: 4px 6px; text-align: left; }

/* Comptabilité : filtre et mois */
.cp-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.cp-filter .field input { width: auto; }
.tbl tr.cp-month td { background: var(--surface-2); position: sticky; top: 0; }
@media (max-width: 600px) {
  .tbl.cp-tbl th:nth-child(3), .tbl.cp-tbl td:nth-child(3), .tbl.cp-tbl th:nth-child(4), .tbl.cp-tbl td:nth-child(4) { display: none; }
}

/* Sections repliables partout (même lumière que l'accueil) */
details.gfold { margin-bottom: 12px; }
details.gfold > .dfold-body > .card { box-shadow: none; }
details.gfold .fold-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
/* Grilles (ex. Immeubles sur ordinateur) : une carte fermée garde la hauteur de son titre, sans grand vide blanc */
.grid:has(> details.gfold) { align-items: start; }
.grid > details.gfold:not([open]) { align-self: start; }

/* Signature + timbre : aperçu sur une feuille A4 (1 px = 1 mm) */
.sign-box { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.sign-a4 { position: relative; flex: none; width: 210px; height: 297px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 18px 16px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.sign-a4 i { display: block; height: 5px; border-radius: 3px; background: #d9d6cf; }
.sign-a4 img { display: block; height: auto; max-width: none; margin: 6px 0 2px; }
.sign-a4 span { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: #999; }
.sign-ctl { flex: 1 1 200px; min-width: 0; }

/* Statistiques des annonces : mini-histogramme des vues */
.pub-bars { display: flex; align-items: flex-end; gap: 2px; height: 46px; margin-top: 10px; padding: 2px; border-bottom: 1px solid var(--border); }
.pub-bars i { flex: 1; min-height: 1px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .8; }

/* Langues : « FR | DE | EN | IT | PT | ES » (app de gestion et portail) */
.lang-mini { display: inline-flex; align-items: center; padding: 2px 4px; margin: 2px 0 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.lang-mini button { position: relative; border: 0; background: none; padding: 6px 8px; font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-3); cursor: pointer; border-radius: 999px; }
.lang-mini button:hover { color: var(--text); }
.lang-mini button + button::before { content: ""; position: absolute; left: 0; top: 30%; height: 40%; width: 1px; background: var(--border); }
.lang-mini button[aria-pressed="true"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.lock .lang-mini { display: flex; width: max-content; margin: 4px auto 12px; }

/* Gérances : demandes d'intervention */
.ptl-box { padding: 10px 12px; border-radius: 12px; background: var(--amber-soft, #fff7ed); border: 1px solid var(--border); font-size: 14px; line-height: 1.5; }
.ger-req.is-new { box-shadow: inset 4px 0 0 var(--amber, #d97706); }
.ger-req.is-new.u-urgent { box-shadow: inset 4px 0 0 #dc2626; animation: gerurg 1.6s ease-in-out infinite; }
@keyframes gerurg { 50% { background: rgba(220, 38, 38, 0.07); } }
.ger-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .ger-req.is-new.u-urgent { animation: none; } }
/* pastille des nouvelles demandes des gérances */
.navbtn { position: relative; }
.nav-n { position: absolute; top: 0; left: calc(50% + 9px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #2563eb; color: #fff; font: 700 11px/18px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--bg, #fff); }
.nav-n.u-urgent { background: #dc2626; }
/* intervention : heure de → à, urgence */
.t-hours .t-hrow { margin-top: 6px; }
.t-hrow { display: flex; align-items: center; gap: 8px; }
.t-hrow input { flex: 1; min-width: 0; }
.t-urg { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--red-soft, #fde8e8); cursor: pointer; }
.t-urg input { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; border: 0; flex: none; accent-color: #dc2626; box-shadow: none; }
/* horaire : « de » / « à » devant chaque heure ; sur iPhone l'heure vide reste visible et ne déborde pas */
.hor-t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hor-tl { font-size: 12px; color: var(--text-2); width: 14px; flex: none; }
.hor-grid input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-height: 40px; max-width: 100%; box-sizing: border-box; text-align: left; }
.hor-grid input[type=time]::-webkit-date-and-time-value { text-align: left; }
.t-hrow input[type=time] { -webkit-appearance: none; appearance: none; min-height: 42px; box-sizing: border-box; }
/* heure vide : « --:-- » visible sur iPhone (Safari laisse le champ blanc) */
.tph { position: relative; display: block; flex: 1; min-width: 0; }
.tph > input { width: 100%; }
.tph > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--text-3); pointer-events: none; font-size: 14px; }
.tph.v > i, .tph:focus-within > i { display: none; }
@media (hover: hover) and (pointer: fine) { .tph > i { display: none; } }
/* statut d'une intervention : 3 boutons de couleur */
.st-radios { border: 0; padding: 0; margin: 0; min-width: 0; }
.st-radios legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.st-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.st-opt { display: block; cursor: pointer; }
.st-opt input { position: absolute; opacity: 0; pointer-events: none; }
.st-opt span { display: block; text-align: center; padding: 10px 4px; border-radius: 12px; border: 2px solid var(--border); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-opt input:focus-visible + span { outline: 2px solid var(--accent, #4f46e5); outline-offset: 2px; }
.st-afaire input:checked + span { border-color: #dc2626; background: rgba(220, 38, 38, .1); }
.st-planifie input:checked + span { border-color: #d97706; background: rgba(217, 119, 6, .12); }
.st-fait input:checked + span { border-color: #16a34a; background: rgba(22, 163, 74, .12); }
.ger-unread { color: #dc2626; } .ger-unread b { color: #dc2626; }
.btn.cloture { background: #16a34a; color: #fff; border-color: #16a34a; }
/* rien ne dépasse en largeur dans une fenêtre (sinon elle « flotte » de gauche à droite sur iPhone) */
#sheet { overflow-x: hidden; max-width: 100vw; }
.sheet-body select, .sheet-body input, .sheet-body textarea { max-width: 100%; }
.t-hrow .tph { min-width: 0; }
/* facture d'intervention */
.fact-mat { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 6px; margin-bottom: 6px; }
.fact-adj { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 70px; gap: 6px; }
.kv-tot { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px; border-radius: 12px; background: var(--surface-2, #f4f4f2); }
.kv-tot b { text-align: right; }
.kv-tot .big { font-size: 17px; font-weight: 800; }
/* menu de gauche : sections, sous-rubriques, raccourcis « + » */
.sidenav .nav-group { margin: 12px 0 2px 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sidenav .navbtn.nav-sub { padding-left: 12px; } /* toutes les rubriques alignées sur la même colonne d’icônes */
.sidenav .navbtn.nav-plus { padding: 4px 10px 4px 47px; min-height: 30px; font-size: 12.5px; font-weight: 600; color: var(--accent, #4f46e5); }
.sidenav .navbtn.nav-plus .ic { display: none; }
.sidenav { overflow-y: auto; }
/* pastille des gérances dans la barre de gauche : à droite du libellé, l'icône reste visible */
.sidenav .navbtn { position: relative; }
.sidenav .navbtn .nav-n { position: static; margin-left: auto; box-shadow: none; }
.ptl-place { margin: 6px 0 0; } .ptl-place dd a { font-weight: 600; }
/* signature digitale (fiche d'engagement) */
.sig-pad { display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 3 / 1; background: #fff; border: 1.5px dashed var(--border-strong, #b8b2a7); border-radius: 12px; touch-action: none; cursor: crosshair; margin-bottom: 6px; }
/* jour de la semaine dans la case de la date */
.dwrap { position: relative; display: block; }
.dwrap > input { width: 100%; }
.dwrap .dow { position: absolute; right: 42px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 13px; font-weight: 650; color: var(--accent, #4f46e5); text-transform: capitalize; }
/* tarifs : petites cases avec l'unité (€/h, €) dedans */
.field.mini { font-size: 12.5px; }
.sfx { position: relative; display: block; }
.sfx > input { width: 100%; padding-right: 52px; }
.sfx > i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; font-weight: 650; color: var(--text-3); pointer-events: none; }
@media (max-width: 380px) { .sfx > input { padding-right: 46px; } .sfx > i { right: 7px; font-size: 11px; } }
.field.mini .rq-num, label:has(> .sfx) .rq-num { display: none; }
.avatar.met-ic { font-size: 24px; line-height: 1; letter-spacing: -3px; }
/* icône (emoji) choisie par la personne : bien remplir le cercle */
.av-emo { font-size: 24px; line-height: 1; } .pp-circle .av-emo { font-size: 42px; }
/* tarifs : petite grille alignée (payé / facturé × heure / déplacement) */
.tarif-grid { display: grid; grid-template-columns: minmax(96px, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.tarif-grid .tg-h { font-size: 12px; font-weight: 650; color: var(--text-3); text-align: center; }
.tarif-grid .tg-r { font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 1.25; }
/* photo de profil dans un cercle */
.avatar .av-ph { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar:has(.av-ph) { padding: 0; overflow: hidden; }
.photo-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-circle { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 28px; font-weight: 700; color: var(--text-2); flex: none; border: 2px solid var(--border); }
.pp-circle img { width: 100%; height: 100%; object-fit: cover; }
.mini-av { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; overflow: hidden; align-items: center; justify-content: center; vertical-align: -5px; margin-right: 5px; font-size: 14px; letter-spacing: -3px; background: var(--surface-2); } .mini-av img { width: 100%; height: 100%; object-fit: cover; }
/* rapport du portail : cases à cocher */
.rep-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rep-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.rep-checks input { width: 18px; height: 18px; }
.rep-grp { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin: 8px 0 0; background: var(--surface, #fff); }
.rep-grp > summary { cursor: pointer; font-size: 14px; }
.rep-grp[open] > summary { margin-bottom: 8px; }
.rep-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.rep-tools input { flex: 1; min-width: 0; }
.rep-scroll { max-height: 220px; overflow-y: auto; padding: 2px; }
.rep-checks label[hidden] { display: none; }
/* aperçu de l'invitation au portail (email mis en forme) */
.inv-prev summary { cursor: pointer; }
.inv-card { margin-top: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: #1f1f1f; overflow-x: auto; }
/* ⚠️ contentieux : rouge clignotant (factures impayées en litige) */
@keyframes contBlink { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.badge.cont-blink, .section-label.cont-blink { background: #dc2626; color: #fff; animation: contBlink 1.1s ease-in-out infinite; }
.section-label.cont-blink { display: inline-block; padding: 3px 10px; border-radius: 999px; }
@keyframes contPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); border-color: #dc2626; } 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); border-color: #fca5a5; } }
.cont-blink-box { border: 2px solid #dc2626 !important; animation: contPulse 1.2s ease-in-out infinite; } /* le texte reste lisible : seul le cadre clignote */
@media (prefers-reduced-motion: reduce) { .cont-blink, .cont-blink-box { animation: none; } }
/* onglets : libellés courts sur téléphone */
.tab-short { display: none; }
@media (max-width: 560px) { .tab-long { display: none; } .tab-short { display: inline; } }
/* logo des agences (gérances) */
img.org-logo{height:16px;max-width:44px;object-fit:contain;vertical-align:-3px;border-radius:3px;background:#fff}
img.org-logo.big{height:26px;max-width:72px;vertical-align:-7px;margin-right:8px;border-radius:5px}
img.org-logo.xl{height:40px;max-width:110px;vertical-align:middle;margin-right:10px;border-radius:6px}
.org-logo-pick{display:flex;gap:12px;align-items:center;padding:10px;border:1px dashed var(--line,#ddd);border-radius:12px}
.org-logo-box{flex:0 0 64px;width:64px;height:64px;border-radius:12px;background:#fff;border:1px solid var(--line,#ddd);display:grid;place-items:center;text-align:center;overflow:hidden}
.org-logo-box img{max-width:100%;max-height:100%;object-fit:contain}
/* devis : pastilles, cadres chef / directeur, bandeau violet */
.dball{flex:none;width:14px;height:14px;border-radius:50%;display:inline-block;background:#c9c9c9;box-shadow:0 0 0 2px #fff,0 0 0 3px rgba(0,0,0,.08)}
.dball-green{background:#22a35a}.dball-yellow{background:#f2b705;animation:devBlink 1.2s infinite}.dball-red{background:#d63c3c;animation:devBlink .8s infinite}
.imm-row .t-sm{display:none}@media (max-width:520px){.imm-row .t-lg{display:none}.imm-row .t-sm{display:inline}}
.loc-tabs .t-sm{display:none}@media (max-width:520px){.loc-tabs .t-lg{display:none}.loc-tabs .t-sm{display:inline}}
.imm-btns{display:flex;gap:8px;flex-wrap:wrap}.imm-btns .actions{margin:0}
.imm-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:-6px 0 16px}.imm-row .tabs{flex:1 1 330px;max-width:560px;margin:0}
.dev-pf-list{display:flex;flex-direction:column;gap:4px}.dev-pf{display:flex;align-items:center;gap:6px;font-size:13px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}.dev-pf .btn{margin-left:auto}
.dball-prep{background:#f2b705}.dball-draft{background:#22a35a;box-shadow:0 0 0 2px #fff,0 0 0 4px #22a35a}
.dball-purple{background:#8b5cf6;animation:devBlink 1.4s infinite}.dball-ok{background:#22a35a}.dball-done{background:#2f6fd6}.dball-refuse{background:#7a7a7a}
@keyframes devBlink{50%{opacity:.35}}
.dev-row{align-items:center}
.dev-banner{border:2px solid #8b5cf6;border-radius:16px;padding:12px;background:rgba(139,92,246,.06);animation:devGlow 1.6s ease-in-out infinite}
@keyframes devGlow{0%,100%{box-shadow:0 0 0 0 rgba(139,92,246,.55)}50%{box-shadow:0 0 0 7px rgba(139,92,246,0),0 0 18px 2px rgba(139,92,246,.35)}}
@media (prefers-reduced-motion:reduce){.dev-banner,.dball{animation:none}}
.dev-bline{border-bottom:1px solid var(--line,#eee)}.dev-bline:last-child{border-bottom:0}
.dev-bact{display:flex;gap:8px;flex-wrap:wrap;padding:0 12px 10px 38px}
.dev-box{border:2px solid var(--line,#ddd);border-radius:14px;padding:12px;display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:0}
.dev-box>legend{font-weight:800;padding:0 6px}
.dev-chef{border-color:#f2b705;background:rgba(242,183,5,.05)}.dev-chef>legend{color:#a87900}
.dev-dir{border-color:#3b5bdb;background:rgba(59,91,219,.04)}.dev-dir>legend{color:#3b5bdb}
.dev-crow{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr);gap:6px;margin-bottom:6px}
.dev-drow{display:grid;grid-template-columns:1fr;gap:6px;padding:8px 0;border-bottom:1px dashed var(--line,#ddd)}
@media (min-width:640px){.dev-drow{grid-template-columns:minmax(0,1.3fr) minmax(0,1.3fr) minmax(0,.8fr);align-items:center}}
.dev-ph{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:6px}
.dev-ph figure{margin:0;position:relative;aspect-ratio:1;border-radius:10px;overflow:hidden;background:var(--surface-2,#f2f2f2)}
.dev-ph img{width:100%;height:100%;object-fit:cover}
.dev-ph figure .btn{position:absolute;top:2px;right:2px;background:rgba(255,255,255,.85)}
.dev-n{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#8b5cf6;color:#fff;font-size:11px}
.dev-btns{display:flex;flex-wrap:wrap;gap:8px}.dev-btns .btn{flex:0 0 auto;width:auto;white-space:nowrap}
/* devis : cadre Prestations (catalogue à cocher), protocole d'entretien, type de devis */
.dev-prest{border-color:#2f9e6a;background:rgba(47,158,106,.05)}.dev-prest>legend{color:#23784f}
.dev-pcats{display:flex;flex-direction:column;gap:6px}
.dev-pg{border:1px solid var(--border,#ddd);border-radius:12px;background:var(--surface,#fff)}
.dev-pg>summary{cursor:pointer;padding:10px 12px;font-weight:650;list-style:none;display:flex;align-items:center;gap:8px}
.dev-pg>summary::-webkit-details-marker{display:none}
.dev-pg>summary::after{content:'▸';margin-left:auto;color:var(--text-3,#999)}.dev-pg[open]>summary::after{content:'▾'}
.dev-pn{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#2f9e6a;color:#fff;font-size:12px}
.dev-pi{padding:8px 12px;border-top:1px solid var(--border,#eee)}
.dev-pi>label{display:flex;gap:8px;align-items:flex-start;cursor:pointer;font-size:14px;line-height:1.35}
.dev-pi>label input{width:20px;height:20px;min-height:0;flex:none;margin-top:1px}
.dev-pq{display:grid;grid-template-columns:90px 110px minmax(0,1fr);gap:6px;margin:8px 0 2px 28px}
.dev-pi:not(.dev-free):not(:has(input[name=pk]:checked)) .dev-pq{display:none}
.dev-free{border:1px dashed var(--border,#ddd);border-radius:12px;margin-bottom:6px;display:grid;gap:6px}
.dev-free .dev-pq{margin:0}
@media (max-width:520px){.dev-pq{grid-template-columns:1fr 1fr;margin-left:0}.dev-pq input[name^=pd_]{grid-column:1/-1}}
.dev-proto{display:flex;flex-direction:column;border:1px solid var(--border,#ddd);border-radius:12px;overflow:hidden;background:var(--surface,#fff)}
.dev-proto-r{display:grid;grid-template-columns:minmax(0,1fr) repeat(4,48px);gap:4px;align-items:center;padding:6px 10px;border-top:1px solid var(--border,#eee)}
.dev-proto-r input[type=checkbox]{width:20px;height:20px;min-height:0;justify-self:center}
.dev-proto-h{border-top:0;background:var(--surface-2,#f4f4f4);font-size:11px}.dev-proto-h b{text-align:center}
form[data-kind=contrat] .dev-k-tr{display:none !important}
form:not([data-kind=contrat]) .dev-k-ct{display:none !important}

/* Paiements : le navigateur ne dessine que les immeubles visibles à l'écran (beaucoup de cases mois × locataires) */
.pay-stack > .card { content-visibility: auto; contain-intrinsic-size: auto 600px; }
@media print { .pay-stack > .card { content-visibility: visible; } }

/* Maintenance : info repliable sur les unités des devis */
.units-info { margin-top: 18px; } .units-info > summary { cursor: pointer; list-style: none; } .units-info > summary::-webkit-details-marker { display: none; }
.units-grid { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; align-items: baseline; } .units-grid > b { font-variant-numeric: tabular-nums; }

/* menu : rubrique masquée dans les réglages */
.navbtn.nav-masked { opacity: .55; cursor: not-allowed; letter-spacing: .04em; font-weight: 700; }

/* 🏠 Biens : affiche horizontale, photos à faire défiler, plein écran */
.bien-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.bien-card { position: relative; background: var(--card, #fff); border: 1px solid var(--line, #e5e0d8); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.06)); }
.bien-car { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 16 / 9; background: #e9e5df; }
.bien-car::-webkit-scrollbar { display: none; }
.bien-car img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; cursor: zoom-in; }
.bien-nophoto { flex: 1; display: grid; place-items: center; font-size: 48px; opacity: .5; }
.bien-media { position: relative; }
.car-arrow { position: absolute; top: 50%; transform: translateY(-50%); border: 0; padding: 0; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 24px; line-height: 34px; cursor: pointer; }
.car-arrow.l { left: 8px; } .car-arrow.r { right: 8px; }
.car-count { position: absolute; top: 8px; right: 10px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.bien-info { padding: 10px 14px 12px; cursor: pointer; line-height: 1.45; }
.bien-new { display: inline-block; animation: bien-blink 1.4s ease-in-out infinite; }
@keyframes bien-blink { 50% { opacity: .35; } }
.piece-row { display: grid; grid-template-columns: 1.3fr 1.4fr .6fr 1fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
@media (max-width: 600px) { .piece-row { grid-template-columns: 1fr 1fr; } .piece-row [name=p_note] { grid-column: 1 / 2; } }
.bien-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.bien-thumb { position: relative; width: 96px; } .bien-thumb img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.bien-thumb span { font-size: 12px; display: flex; gap: 4px; align-items: center; }
dialog.bien-full { padding: 0; border: 0; background: #000; width: 100vw; max-width: 100vw; margin: auto 0; max-height: 92vh; overflow: hidden; }
dialog.bien-full::backdrop { background: rgba(0,0,0,.9); }
.bf-car { aspect-ratio: auto; height: min(70vh, 56.25vw); background: #000; }
.bf-car img { object-fit: contain; cursor: default; }
.bf-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 18px; cursor: pointer; }
.bf-cap { color: #fff; margin: 0; padding: 10px 14px 14px; font-size: 15px; }
/* 📍 Où ? : nos immeubles + lieux déjà travaillés, filtrés par la recherche */
.lieu-list { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.lieu-list .row[aria-pressed=true] { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.lieu-sel { margin: 8px 0 0; }
.lieu-pick { min-width: 0; }
.lieu-list .row .grow { min-width: 0; }
.lieu-list .row .title, .lieu-list .row .meta { white-space: normal; overflow-wrap: anywhere; }
/* 🎨 légende des couleurs : pallini sous « Réglages » (bulle au survol ou au toucher) + liste dans Réglages */
.leg-dots { position: relative; display: flex; flex-wrap: wrap; gap: 7px; padding: 6px 12px 2px 14px; }
.leg-dot { position: static; width: 13px; height: 13px; padding: 0; border: 0; border-radius: 50%; background: var(--c); cursor: help; box-shadow: 0 0 0 2px var(--surface); }
.leg-dot:hover, .leg-dot:focus-visible, .leg-dot.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); outline: none; }
.leg-tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 6px; right: 6px; transform: none; z-index: 50; width: auto; padding: 8px 10px; border-radius: 10px;
  background: var(--text); color: var(--surface); font-size: 12.5px; font-weight: 600; line-height: 1.35; text-align: left; white-space: normal; box-shadow: var(--shadow-lg); border-left: 5px solid var(--c); }
.leg-dot:hover .leg-tip, .leg-dot:focus-visible .leg-tip, .leg-dot.on .leg-tip { display: block; }
.leg-sw { flex: none; width: 26px; height: 8px; border-radius: 4px; }
/* contours de couleur par activité (mêmes couleurs que la légende) ; mk-on = clignote */
.mk { border: 2px solid var(--mk) !important; }
.mk-on { animation: mkGlow 1.5s ease-in-out infinite; }
@keyframes mkGlow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mk) 55%, transparent); } 50% { box-shadow: 0 0 0 7px transparent, 0 0 18px 2px color-mix(in srgb, var(--mk) 35%, transparent); } }
.mk-int { --mk: #F97316; } .mk-ger { --mk: #1D4ED8; } .mk-bien { --mk: #0077BE; } .mk-dev { --mk: #8B5CF6; } .mk-loc { --mk: #0D9488; } .mk-hot { --mk: #92400E; } .mk-pub { --mk: #DC2626; } .mk-avis { --mk: #475569; } .mk-plan { --mk: #4F46E5; }
@media (prefers-reduced-motion: reduce) { .mk-on { animation: none; } }
/* dans un banner de couleur (devis, contours d'activité) : une seule bordure, celle du banner — la section pliable intérieure ne s'allume pas en orange */
.dev-banner details.dfold, .mk details.dfold { animation: none !important; box-shadow: none !important; border: 0 !important; background: transparent !important; padding: 2px 0 0 !important; }
/* 📊 Rapports : aperçu du tableau */
.rpt-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-tbl th, .rpt-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.rpt-tbl th { background: var(--surface-2); position: sticky; top: 0; }
.rpt-cb { width: auto !important; display: inline-block !important; margin: 0 6px 0 0 !important; vertical-align: middle; min-height: 0 !important; }
.rpt-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rpt-acts .btn { flex: none; }
.rpt-save { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: 1 1 280px; }
.rpt-save input { flex: 1 1 200px; min-width: 0; }
/* 🖨️ Statistiques sur mesure : listes à cocher + graphiques */
.rpt-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; margin-top: 10px; }
.rpt-pick { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; background: var(--surface); min-width: 0; }
.rpt-pick > summary { cursor: pointer; font-weight: 700; }
.rpt-pick-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.rpt-pick-tools input { flex: 1 1 120px; min-width: 0; }
.rpt-pick-list { max-height: 220px; overflow-y: auto; display: grid; gap: 2px; }
.rpt-pick-list label { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 3px 2px; cursor: pointer; }
.vz { color: var(--text); }
.vz-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.vz-tile { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.vz-tv { font-size: 26px; font-weight: 800; line-height: 1.1; }
.vz-tl { font-size: 13px; color: var(--text-2); }
.vz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.vz-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); min-width: 0; break-inside: avoid; }
.vz-card h4 { margin: 0 0 8px; font-size: 14px; }
.vz-donut { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.vz-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin-top: 6px; }
.vz-leg.col { flex-direction: column; margin: 0; }
.vz-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.vz-stack { display: flex; gap: 2px; height: 18px; border-radius: 6px; overflow: hidden; }
.vz-stack i { display: block; min-width: 3px; }
.vz-hb { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.vz-hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-ht { background: var(--surface-2); border-radius: 4px; height: 10px; overflow: hidden; }
.vz-ht i { display: block; height: 100%; border-radius: 4px; }
.vz-hv { white-space: nowrap; color: var(--text-2); }
@media print { .vz-stack i, .vz-ht i, .vz-leg i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.nav-links { font-size: 13px; line-height: 1.6; } .nav-links a { white-space: nowrap; font-weight: 600; } /* 🧭 itinéraire : Google Maps · Waze · Plans */

/* 📥 documents envoyés par le locataire, à vérifier */
.recu-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border, #e5e2da); display: grid; gap: 6px; }
.recu-top, .recu-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.recu-act select, .recu-act input { flex: 1 1 200px; min-width: 0; }
