/* Espace syndic : tableau de bord pour écran de bureau. */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(420px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 32px; display: grid; gap: 14px; }
.login h1 { font-size: 1.6rem; }
.sub, .hint { color: var(--muted); font-size: 0.95rem; }
.login form { display: grid; gap: 8px; }
.login label { font-weight: 700; font-size: 0.9rem; margin-top: 6px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--white); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: var(--focus); }
.form-msg { min-height: 1.3em; color: var(--brick); font-size: 0.9rem; }
.login .btn { margin-top: 4px; }
.linklike { background: none; border: 0; padding: 4px 0; color: var(--leaf-dark); text-decoration: underline; text-align: left; }
.linklike.light { color: #cfe0f2; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; text-decoration: none; color: inherit; letter-spacing: -0.02em; }

/* Coque */
#shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.rail { background: var(--ink); color: #e3eef9; padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.rail .brand { color: #fff; padding: 0 6px; }
.rail select { background: var(--ink-2); color: #fff; border-color: #2a5784; }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: #cfe0f2; text-decoration: none; font-weight: 600; }
#nav a:hover { background: var(--ink-2); color: #fff; }
#nav a[aria-current="page"] { background: var(--mint); color: var(--ink); }
.badge { margin-left: auto; background: var(--saffron); color: var(--ink); border-radius: 999px; padding: 0 8px; font-size: 0.78rem; font-weight: 800; }
.rail-foot { margin-top: auto; display: grid; gap: 6px; font-size: 0.88rem; }
.rail-foot a { color: #cfe0f2; }
.who { color: #cfe0f2; overflow-wrap: anywhere; }
.main { padding: 28px 36px 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.7rem; }
.page-head p { color: var(--muted); margin-top: 4px; }
.note { background: var(--saffron-bg); border: 1px solid #ecd08f; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.loading { color: var(--muted); padding: 40px 0; }

/* Éléments communs */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; background: var(--mint); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--saffron-bg); color: #7a5300; }
.chip.late { background: var(--brick-bg); color: var(--brick); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.panel h2 { font-size: 1.05rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.count { background: var(--mint); border-radius: 999px; padding: 0 9px; font-size: 0.8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .panel { margin-bottom: 0; }
.empty { color: var(--muted); padding: 10px 0; }
.small { font-size: 0.88rem; }
.block { display: block; }
.link { background: none; border: 0; padding: 0; color: var(--leaf-dark); text-decoration: underline; }
.msg { color: var(--leaf-dark); font-weight: 600; margin-top: 8px; }
.warn-box { background: var(--saffron-bg); border-radius: 8px; padding: 12px 14px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.inline { display: inline; }

/* Chiffres clés */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.kpis > div { padding: 16px 18px; border-left: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.kpis > div:first-child { border-left: 0; }
.kpis b { font-size: 1.6rem; letter-spacing: -0.03em; }
.kpis b small { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.kpis span { color: var(--muted); font-size: 0.88rem; }
.kpis .bad b { color: var(--brick); }
.kpis .warn { background: var(--saffron-bg); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t .r, .t th.r { text-align: right; }
.t .neg { color: var(--brick); font-weight: 700; }
.t tbody tr:hover { background: #eef5fc; }
.t tr.click { cursor: pointer; }
.t td.act { text-align: right; white-space: nowrap; }
.t.small td, .t.small th { padding: 6px 8px; }
.t tfoot td { font-weight: 800; border-top: 2px solid var(--line); padding-top: 20px; padding-bottom: 14px; }
.btn-s { padding: 6px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--white); font-weight: 700; font-size: 0.88rem; }
.btn-s:hover { border-color: var(--ink); }
.btn-s.ok { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.btn-s.ok:hover { background: var(--leaf-dark); }
.btn-s.bad { color: var(--brick); border-color: #e3b3ac; }
.btn-s[disabled] { opacity: 0.5; cursor: not-allowed; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"], .toolbar input[type="text"] { width: 260px; }
.toolbar select { width: auto; }
.tools { margin-left: auto; display: flex; gap: 8px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.plain small { display: block; color: var(--muted); }

/* Graphiques simples */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; }
.bar { background: var(--mint); height: 12px; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brick); border-radius: 6px; }
.cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 190px; align-items: end; }
.cols > div { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 6px; }
.cols .num { font-size: 0.78rem; font-weight: 700; }
.cols i { align-self: end; background: var(--leaf); border-radius: 6px 6px 0 0; display: block; }
.cols small { color: var(--muted); font-size: 0.75rem; line-height: 1.2; }

/* Abonnement */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.calc-grid label { font-weight: 700; display: block; margin-bottom: 6px; }
.seg { display: flex; margin: 12px 0; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; padding: 9px 8px; border: 0; background: var(--white); font-weight: 700; }
.seg button.on { background: var(--brand); color: #fff; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.big { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.drawer-sub { color: var(--muted); margin-bottom: 12px; }

/* Panneau latéral, dialogues, messages */
#drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-back { position: absolute; inset: 0; background: rgba(7, 34, 61, 0.5); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 100%); background: var(--white); display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18); animation: slide 0.18s ease-out; }
.drawer-panel header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-panel h2 { font-size: 1.15rem; }
.drawer-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 0; background: var(--mint); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.confirm { border: 0; border-radius: 14px; padding: 24px; width: min(440px, calc(100% - 32px)); }
dialog.confirm::backdrop { background: rgba(7, 34, 61, 0.5); }
dialog.confirm textarea { margin-top: 10px; min-height: 80px; }
dialog.confirm form, dialog.confirm .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 80; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; max-width: 360px; }
.toast.err { background: var(--brick); }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpis > div:nth-child(4) { border-left: 0; } .kpis > div:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) {
  #shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: column; }
  #nav { grid-template-columns: repeat(3, 1fr); }
  .rail-foot { margin-top: 0; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .calc-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis > div { border-left: 0; border-top: 1px solid var(--line); }
}
[hidden] { display: none !important; }


/* Formulaires Desktop et espace habitant */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid label { display: grid; gap: 6px; color: var(--ink); font-size: .9rem; font-weight: 650; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { min-width: 0; }
.owner-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.owner-kpis > div { border-left: 1px solid var(--line); }
.owner-kpis > div:first-child { border-left: 0; }
#expense-form-panel { margin-top: 18px; background: #fbfdff; }
#expense-form-panel[hidden] { display: none; }
.btn-primary:disabled, button:disabled { opacity: .55; cursor: wait; }
#nav a { min-height: 42px; }
.main { max-width: 1800px; width: 100%; margin: 0 auto; }
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .owner-kpis { grid-template-columns: 1fr; }
  .owner-kpis > div { border-left: 0; border-top: 1px solid var(--line); }
  .owner-kpis > div:first-child { border-top: 0; }
}


/* Cotisations : synthèse, calendrier par période et saisie administrative. */
.dues-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.dues-summary > div { display:grid; gap:5px; padding:12px 14px; background:#f5f8fb; border-radius:9px; }
.dues-summary span { color:var(--muted); font-size:.84rem; }
.dues-summary b { font-size:1.25rem; }
.dues-calendar { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0 20px; }
.dues-cell { min-width:0; display:grid; gap:4px; padding:10px; border:1px solid var(--line); border-radius:9px; background:#f5f7f9; }
.dues-cell b { font-size:.84rem; overflow-wrap:anywhere; }
.dues-cell span,.dues-cell small { font-size:.78rem; }
.dues-cell.paid { background:#e7f5e9; border-color:#b9dfbf; color:#1b5e20; }
.dues-cell.pending { background:#fff1d9; border-color:#efd49c; color:#805500; }
.dues-cell.overdue { background:#fde8e7; border-color:#e9b9b5; color:#a12d25; }
.dues-cell.due { background:#fff8dc; border-color:#eadb9c; color:#755d00; }
.dues-cell.future { background:#f7f8fa; color:var(--muted); }
.dues-cell.none { background:#f7f8fa; color:var(--muted); }
.manual-payment { margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:10px; background:#f9fbfd; }
.manual-payment form { display:grid; gap:12px; }
.manual-payment form > label { display:grid; gap:5px; font-weight:650; font-size:.9rem; }
.manual-payment fieldset { border:1px solid var(--line); border-radius:8px; padding:12px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 12px; }
.manual-payment legend { padding:0 5px; font-weight:700; font-size:.9rem; }
.manual-period { display:flex; align-items:center; gap:8px; min-width:0; font-size:.88rem; }
.manual-period input { width:auto; }
.manual-period span { flex:1; }
.manual-period b { white-space:nowrap; }
@media(max-width:900px) { .dues-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } .dues-calendar { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:520px) { .manual-payment fieldset { grid-template-columns:1fr; } }


/* Direction artistique raffinée — espace Desktop */
:root { --ink:#07223d; --ink-2:#0f3558; --brand:#306488; --brand-dark:#1e4c72; --brand-deep:#184868; --leaf:#306488; --leaf-dark:#1e4c72; --mint:#e3f0fb; --paper:#f3f8fd; --line:#d6e3f0; --muted:#5b6f84; --focus:0 0 0 3px rgba(48,100,136,.28); }
body { background:#f3f8fd; color:#14283d; font-size:14px; line-height:1.5; }
#shell { grid-template-columns:236px minmax(0,1fr); }
.rail { background:var(--brand); padding:22px 14px 18px; gap:20px; border-right:1px solid rgba(255,255,255,.08); }
.rail .brand { font-size:1.08rem; letter-spacing:-.035em; }
.rail select { width:100%; min-height:38px; padding:8px 34px 8px 11px; border:1px solid rgba(255,255,255,.25); border-radius:8px; background-color:var(--brand-dark); color:#f5f8fa; font-size:13px; }
#nav { gap:4px; }
#nav a { min-height:38px; padding:8px 10px; gap:10px; border-radius:7px; font-size:13px; font-weight:550; color:#c4d6ea; transition:background .15s ease,color .15s ease; }
#nav a[aria-current="page"] { background:#dbeafa; color:#0b3a66; font-weight:650; }
#nav a:hover:not([aria-current="page"]) { background:rgba(255,255,255,.07); }
.main { padding:30px clamp(22px,3vw,48px) 56px; max-width:1680px; }
.page-head { align-items:center; margin-bottom:22px; gap:20px; }
.page-head h1 { font-size:1.55rem; font-weight:700; letter-spacing:-.045em; color:#0a2239; }
.page-head p { font-size:13px; color:#60758a; margin-top:5px; }
.page-head .chip { font-size:11px; padding:4px 9px; }
.panel { background:#fff; border:1px solid #dbe6f1; border-radius:12px; padding:18px 20px; margin-bottom:14px; box-shadow:0 2px 8px rgba(7,34,61,.04); }
.panel h2 { font-size:14px; font-weight:680; letter-spacing:-.015em; margin-bottom:14px; color:#0a2239; }
.panel h3 { font-size:13px; font-weight:680; }
.grid-2 { gap:14px; }
.kpis { border:1px solid #dbe6f1; border-radius:12px; box-shadow:0 2px 8px rgba(7,34,61,.04); }
.kpis > div { padding:14px 16px; gap:5px; }
.kpis b { font-size:1.35rem; font-weight:700; }
.kpis span { font-size:12px; }
.t th { font-size:11px; letter-spacing:.035em; text-transform:uppercase; color:#60758a; font-weight:650; padding:10px 11px; border-bottom:1px solid #dbe6f1; }
.t td { font-size:13px; padding:10px 11px; border-bottom-color:#e4edf6; }
.t tbody tr:hover { background:#f1f7fd; }
.chip { font-size:11px; padding:3px 8px; font-weight:650; }
.count { font-size:11px; padding:2px 8px; }
.toolbar { gap:9px; margin-bottom:14px; }
.toolbar h2 { margin:0; }
.tools { gap:7px; align-items:center; }
.toolbar input[type="search"], .toolbar input[type="text"] { width:min(240px,28vw); }
.toolbar input, .toolbar select, .toolbar button { min-height:34px; }
.toolbar select { min-width:142px; padding:6px 28px 6px 10px; font-size:12px; }
.toolbar label.inline { display:inline-flex; align-items:center; gap:7px; color:#71808c; font-size:12px; white-space:nowrap; }
.toolbar label.inline input { width:145px; min-height:34px; padding:6px 9px; font-size:12px; }
.btn { min-height:36px; padding:8px 14px; border-radius:8px; font-size:12px; font-weight:650; gap:6px; }
.btn.sm { min-height:32px; padding:6px 11px; font-size:11.5px; border-radius:7px; }
.btn-primary { background:var(--leaf); }
.btn-primary:hover { background:var(--leaf-dark); }
.btn-ghost { border-color:#dce4e7; color:#435967; background:#fff; }
.btn-ghost:hover { border-color:#b9ceca; background:#f1f7f5; color:#245e5a; }
.btn-s { min-height:29px; padding:5px 9px; border-radius:6px; font-size:11px; font-weight:650; }
input, select, textarea { min-height:38px; padding:8px 10px; border:1px solid #dce4e8; border-radius:7px; font-size:13px; }
input:focus, select:focus, textarea:focus { border-color:#7eaaa5; box-shadow:0 0 0 3px rgba(40,124,120,.12); }
.form-grid { gap:12px 16px; }
.form-grid label { font-size:12px; gap:5px; }
.plain li { padding:10px 0; font-size:13px; }
.plain small { font-size:11px; margin-top:3px; }
.calc-grid { gap:34px; align-items:start; }
.calc-grid label { font-size:12px; margin-bottom:7px; }
.seg { margin:12px 0 16px; padding:3px; gap:3px; border:1px solid #e3e9eb; border-radius:9px; background:#f7f9fa; }
.seg button { min-height:34px; padding:7px 10px; border-radius:6px; font-size:12px; line-height:1.35; font-weight:650; color:#62727d; }
.seg button.on { background:#e0eeeb; color:#245e5a; box-shadow:inset 0 0 0 1px #c8ded9; }
#pay { display:grid; align-content:start; gap:10px; padding:17px; border:1px solid #dbe6f1; border-radius:10px; background:#fbfcfc; }
#pay .big { font-size:1.8rem; line-height:1.15; color:#203d4c; }
#pay p { line-height:1.55; }
#pay h3 { margin-top:5px; }
#pay .kv { gap:8px 14px; font-size:12px; margin:2px 0 5px; }
#pay .btn { justify-self:start; margin-top:4px; }
#calc .t td { padding:8px 9px; }
.dues-summary > div { padding:11px 13px; border:1px solid #edf0f2; background:#fafcfc; }
.dues-calendar { gap:7px; }
.dues-cell { padding:9px; border-radius:8px; }
.drawer-panel { width:min(500px,100%); }
.drawer-panel header { padding:16px 20px; }
.drawer-body { padding:18px 20px; gap:13px; }
.icon-btn { width:32px; height:32px; }
.note { padding:9px 12px; border-radius:8px; font-size:12px; }
@media (max-width:1100px) { #shell { grid-template-columns:220px minmax(0,1fr); } .main { padding:24px 22px 48px; } .toolbar { align-items:flex-start; } }
@media (max-width:900px) { #shell { grid-template-columns:1fr; } .rail { padding:14px; gap:12px; } .rail select { max-width:100%; } .main { padding:20px 16px 42px; } .page-head { align-items:flex-start; } .toolbar { flex-direction:column; align-items:stretch; } .toolbar .tools { margin-left:0; width:100%; flex-wrap:wrap; } .toolbar input[type="search"], .toolbar input[type="text"] { width:min(100%,280px); } }
@media (max-width:560px) { .panel { padding:15px; } .kpis b { font-size:1.2rem; } .toolbar .tools { gap:6px; } .toolbar label.inline { width:100%; justify-content:space-between; } .toolbar label.inline input { width:60%; } }

.rail-hint { margin:-12px 2px 0; color:#9fb2bf; font-size:11px; line-height:1.45; }
.rail-hint[hidden] { display:none; }

/* Cotisations : lignes plus compactes, dans le même thème que l’annuaire des résidents. */
.dues-table .t th { padding-top: 7px; padding-bottom: 7px; }
.dues-table .t td { padding-top: 6px; padding-bottom: 6px; }
.resident-actions { white-space: nowrap; }
.resident-actions .btn-s + .btn-s { margin-left: 6px; }

/* Séparation plus lisible des zones de travail et actions groupées. */
.panel { border-color:#d8e1e6; box-shadow:0 2px 9px rgba(25,48,64,.045); }
.kpis { border-color:#d3dee5; }
.kpis > div { border-color:#d3dee5; }
.grid-2 > .panel { border-color:#d5dfe5; }
.dues-pending .t td.act { display:flex; align-items:center; justify-content:flex-end; gap:9px; }
.dues-pending .t td.act .btn-s { flex:0 0 auto; }
.expense-filters .tools { flex-wrap:wrap; }
.expense-filters label.inline input[type="date"] { width:145px; }

/* Relevé bancaire et réglages */
.stack { display: grid; gap: 12px; max-width: 520px; }
.stack label, .paste { display: grid; gap: 6px; font-weight: 600; }
.paste { margin: 12px 0; }
.paste textarea { min-height: 130px; font: inherit; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; margin-top: 8px; }
.switch-row input { width: auto; margin-top: 4px; }
.switch-row small { display: block; font-weight: 400; }
.t td.wrap { max-width: 360px; overflow-wrap: anywhere; }
.t td.nowrap { white-space: nowrap; }
.periods { display: grid; gap: 4px; margin-top: 8px; }
.manual-period { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.manual-period input { width: auto; }
.t input[type="checkbox"], .switch-row input, .stack input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--leaf); }

/* À faire, relances, cases à cocher */
.todo .plain li { align-items: center; gap: 14px; }
.todo .plain li > span:nth-child(2) { flex: 1; }
.todo-n { min-width: 34px; height: 34px; border-radius: 999px; background: var(--mint); color: var(--ink); display: inline-grid; place-items: center; font-weight: 800; }
.chk { width: 36px; }
.chk input { width: 16px; height: 16px; accent-color: var(--leaf); }
.reminders li { align-items: center; }

/* Menu latéral : bleu du logo (dégradé du fond du logo) */
.rail { background: linear-gradient(180deg, #306488 0%, #1e4c72 100%); color: #fff; border-right: 0; }
.rail .brand { color: #fff; }
.rail select { background-color: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.rail select option { color: var(--ink); }
#nav a { color: rgba(255,255,255,.88); }
#nav a:hover:not([aria-current="page"]) { background: rgba(255,255,255,.14); color: #fff; }
#nav a[aria-current="page"] { background: #fff; color: #1e4c72; font-weight: 700; }
.badge { background: var(--saffron); color: var(--ink); }
#nav a[aria-current="page"] .badge { background: #1e4c72; color: #fff; }
.rail-foot a, .linklike.light { color: #cfe6fa; }
.who, .rail-hint { color: rgba(255,255,255,.7); }

/* Lien « nouvelle résidence » du menu */
.rail-add { display: block; margin: 8px 0 4px; padding: 7px 10px; border: 1px dashed rgba(255,255,255,.45); border-radius: 8px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; text-align: center; }
.rail-add:hover { background: rgba(255,255,255,.14); }

/* Mes résidences */
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.res-head .hint { margin: 0; max-width: 60ch; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.res-card { background: #fff; border: 1px solid #dbe6f1; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 8px rgba(7,34,61,.04); min-width: 0; }
.res-card.current { border-color: var(--leaf); box-shadow: 0 0 0 2px rgba(48,100,136,.2); }
.res-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.res-badge { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #fff; background: linear-gradient(135deg, #306488, #4c82a6); }
.res-card h3 { margin: 4px 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.res-city { margin: 0; color: var(--muted); font-size: .9rem; }
.res-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 8px; margin: 10px 0 12px; padding-top: 10px; border-top: 1px solid #e6eef6; }
.res-facts dt { font-size: .75rem; color: var(--muted); }
.res-facts dd { margin: 2px 0 0; font-weight: 700; font-size: .92rem; }
.res-open { margin-top: auto; align-self: flex-start; }
.res-open.on { color: var(--leaf-dark); font-weight: 700; font-size: .9rem; }
.res-add { align-items: center; justify-content: center; text-align: center; border-style: dashed; border-color: #a9c9e6; background: #f6fafe; color: var(--leaf-dark); text-decoration: none; min-height: 190px; }
.res-add:hover { background: #eaf3fb; }
.res-plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: var(--leaf); color: #fff; line-height: 1; }
.res-form { max-width: 760px; }
.res-form fieldset { border: 0; border-top: 1px solid #e6eef6; padding: 14px 0 6px; margin: 0; min-width: 0; }
.res-form legend { font-weight: 700; font-size: .95rem; padding: 0 8px 0 0; color: var(--ink); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; }
.fgrid label { display: grid; gap: 5px; font-weight: 600; font-size: .9rem; }
.fgrid label.wide { grid-column: 1 / -1; }
.fgrid small { font-weight: 400; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e6eef6; }

/* Réglages */
.set { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 1020px; }
.set-nav { position: sticky; top: 12px; display: grid; gap: 2px; }
.set-nav a { padding: 8px 12px; border-radius: 8px; color: #2c4a68; text-decoration: none; font-weight: 600; font-size: .92rem; }
.set-nav a:hover { background: #e3effa; color: var(--leaf-dark); }
.set-main { display: grid; gap: 16px; min-width: 0; }
.set-hero { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #184868, #306488 60%, #4c82a6); }
.set-hero > div { flex: 1; display: grid; min-width: 0; }
.set-hero strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.set-hero span { opacity: .85; font-size: .9rem; overflow-wrap: anywhere; }
.set-hero .chip { background: rgba(255,255,255,.2); color: #fff; opacity: 1; }
.set-avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #1e4c72 !important; opacity: 1 !important; font-weight: 800; font-size: 1.1rem !important; flex: none; }
.set-card { background: #fff; border: 1px solid #dbe6f1; border-radius: 14px; padding: 22px; box-shadow: 0 2px 8px rgba(7,34,61,.04); scroll-margin-top: 12px; }
.set-card header { margin-bottom: 16px; }
.set-card h2 { margin: 0 0 4px; font-size: 1.05rem; color: var(--ink); }
.set-card header p { margin: 0; color: var(--muted); font-size: .9rem; }
.set-card .fgrid .wide { grid-column: 1 / -1; }
.set-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 20px; margin: 0 0 16px; }
.set-kv dt { font-size: .78rem; color: var(--muted); }
.set-kv dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0 0; border-top: 1px solid #e6eef6; cursor: pointer; }
.set-card header + .toggle { border-top: 0; padding-top: 0; }
.toggle b { display: block; font-size: .95rem; }
.toggle small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.toggle input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 38px; min-width: 38px; height: 22px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 999px; background: #b9cbdc; position: relative; cursor: pointer; transition: background .15s; }
.toggle input[type="checkbox"]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input[type="checkbox"]:checked { background: var(--leaf); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }
.toggle input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
.set-links { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.set-links a { display: block; padding: 9px 0; border-bottom: 1px solid #eef3f8; text-decoration: none; font-weight: 600; }
.set-out { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.set-out small { display: block; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .toggle input[type="checkbox"], .toggle input[type="checkbox"]::after { transition: none; } }
@media (max-width: 820px) { .set { grid-template-columns: 1fr; gap: 14px; } .set-nav { position: static; display: flex; overflow-x: auto; gap: 4px; } .set-nav a { white-space: nowrap; background: #eaf3fb; } }
.fgrid { align-items: start; }
.fgrid label { align-content: start; }
.fgrid small { font-size: .8rem; color: var(--muted); }
.res-form h2 { margin-bottom: 10px; font-size: 1.1rem; }

/* Tuile cliquable + fiche d'une résidence */
a.res-link { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.res-link:hover { border-color: var(--leaf); box-shadow: 0 4px 14px rgba(48,100,136,.18); }
.res-open.more { color: var(--leaf-dark); font-weight: 600; font-size: .9rem; }
.res-detail { max-width: 820px; }
.res-detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.res-detail-head > div { flex: 1; min-width: 180px; }
.res-detail-head h2 { margin: 0 0 2px; }
#building[hidden], #building-hint[hidden] { display: none; }

/* Gouvernance de la résidence */
#gov { max-width: 820px; margin-top: 16px; }
.gov-h { margin: 18px 0 4px; font-size: 1.02rem; }
.gov-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.gov-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid var(--line, #dbe5ef); border-radius: 10px; }
.gov-list .toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; }

/* Logo bleu sur la carte de connexion (fond blanc) */
.login .brand-mark { background-image: url("../img/logo-s-blue.png"); }

/* Relevé bancaire : plus d'air entre le texte d'introduction et les boutons d'import */
.panel .toolbar.bank-actions { margin: 20px 0 16px; gap: 12px; }
/* Pièces jointes (réclamations) */
.attach input[type="file"] { padding: 7px 10px; }
.attach small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
