:root {
  font-family: Inter, "Avenir Next", "Segoe UI", Arial, sans-serif;
  color: #202629;
  background: #f8f9fd;
  font-synthesis: none;
  --anthracite: #2c3133;
  --olive: #4169e1;
  --olive-dark: #2448b5;
  --olive-line: #a7baf2;
  --olive-pale: #e5ebff;
  --line: #d9dfec;
  --muted: #677078;
  --danger: #c92f45;
  --danger-pale: #fff0f2;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f8f9fd; }
a { color: inherit; }
.topbar { width: 175px; min-height: 100vh; padding: 24px 13px 18px; position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; color: #243452; background: linear-gradient(180deg,#edf1ff 0%,#d5dfff 100%); border-right: 1px solid #b7c7f3; }
.brand-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; font-size: 19px; font-weight: 780; line-height: 1.05; letter-spacing: -.35px; text-align: left; text-decoration: none; }
.brand span:last-child { font-size: 25px; letter-spacing: .4px; }
.brand-add-button { width: 46px; height: 46px; flex: 0 0 46px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--olive-dark); border: 1px solid #2448b5; border-radius: 7px; box-shadow: 0 3px 8px rgba(36,72,181,.17); font-size: 30px; font-weight: 400; line-height: 1; text-decoration: none; }
.brand-add-button:hover,.brand-add-button:focus { background: #1e3f9c; outline: 3px solid rgba(255,255,255,.7); outline-offset: -4px; }
.main-nav { width: 100%; margin-top: 28px; display: flex; flex-direction: column; gap: 5px; }
.nav-link { position: relative; padding: 11px 12px; display: flex; align-items: center; color: #34456b; border-radius: 5px; text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav-link:hover,.nav-link.active { color: #203b80; background: rgba(255,255,255,.56); }
.nav-link::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; background: transparent; }
.nav-link:hover::after,.nav-link.active::after { background: #4169e1; }
.topbar-actions { width: 100%; margin-top: auto; display: grid; gap: 8px; }
.settings-menu,.notification-menu { position: relative; margin: 0; z-index: 20; }
.settings-menu>summary,.notification-menu>summary { width: 100%; min-height: 42px; padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #30446b; background: rgba(255,255,255,.54); border: 1px solid #b7c7f3; border-radius: 5px; font-size: 13px; font-weight: 750; cursor: pointer; list-style: none; }
.settings-menu>summary::-webkit-details-marker,.notification-menu>summary::-webkit-details-marker { display: none; }
.settings-menu>summary:hover,.settings-menu[open]>summary,.notification-menu>summary:hover,.notification-menu[open]>summary { background: #f5f7ff; }
.notification-badge,.notification-heading span { min-width: 21px; height: 21px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--danger); border-radius: 99px; font-size: 11px; }
.settings-popover,.notification-popover { width: min(360px,calc(100vw - 205px)); padding: 16px; position: absolute; bottom: 0; left: calc(100% + 10px); display: flex; flex-direction: column; background: #fff; border: 1px solid #d0d9ee; border-radius: 7px; box-shadow: 0 18px 45px rgba(37,45,39,.2); }
.notification-popover { min-height: 160px; }
.settings-popover.compact-menu { width: min(330px,calc(100vw - 28px)); min-height: 230px; }
.notification-heading { padding: 2px 2px 11px; display: flex; align-items: center; justify-content: space-between; }
.notification-list { max-height: 260px; overflow-y: auto; }
.menu-notification { margin-bottom: 7px; padding: 11px 12px; display: block; color: #293033; background: #f3f6ff; border-left: 4px solid var(--olive); border-radius: 4px; text-decoration: none; }
.menu-notification.danger { background: #fff0f2; border-left-color: var(--danger); }
.menu-notification.warning { background: #fff6df; border-left-color: #c88c19; }
.menu-notification:hover { filter: brightness(.98); }
.menu-notification strong,.menu-notification small { display: block; }
.menu-notification strong { font-size: 13px; }
.menu-notification small { margin-top: 3px; font-size: 11px; }
.menu-no-notification { margin: 0; padding: 15px 12px; color: var(--muted); background: #f3f6ff; font-size: 13px; }
.settings-profile-link { padding: 12px; display: block; color: #293033; background: #edf2ff; border-radius: 4px; text-decoration: none; }
.settings-profile-link.active,.settings-profile-link:hover { background: #dfe7ff; }
.settings-profile-link span,.settings-profile-link small { display: block; }
.settings-profile-link span { font-size: 13px; font-weight: 750; }
.settings-profile-link small { margin-top: 3px; font-size: 11px; }
.settings-logout { margin-top: auto; padding: 14px 12px 2px; color: #7e2835; border-top: 1px solid #e0e4df; font-size: 13px; font-weight: 750; text-decoration: none; }
.settings-logout:hover { color: #a1162c; }
.login-brand { padding: 24px 3.4% 0; }
main { max-width: none; min-height: 100vh; margin-left: 175px; padding: 24px 28px 44px; }
.login-brand+main { max-width: 520px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.page-heading h1,main>h1 { margin: 0; color: #252b2e; font-size: clamp(24px,2.2vw,32px); line-height: 1.08; letter-spacing: -.8px; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.client-return-link { margin-top: 9px; display: inline-block; font-size: 13px; font-weight: 700; }
.page-heading time { padding-top: 9px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.boxes-heading,.contracts-heading { align-items: center; flex-wrap: wrap; }
.creation-disclosure { margin-left: auto; }
.create-toggle { min-width: 150px; text-align: center; }
.creation-disclosure.is-open { width: 100%; margin-left: 0; }
.creation-disclosure.is-open .create-toggle { margin-left: auto; background: var(--olive-dark); }
.create-form-card { margin: 16px 0 0; }
.property-search-card { margin-top: 0; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.property-search-card h2 { margin-bottom: 5px; }
.property-search-card p { margin: 0; color: var(--muted); font-size: 14px; }
.property-search-form { min-width: min(420px,100%); }
.search-controls { display: grid; grid-template-columns: minmax(130px,1fr) auto; gap: 9px; }
.search-controls button { min-width: 120px; }
.search-controls.live-search-controls { grid-template-columns: 1fr; }
.live-search-status { display: block; min-height: 18px; margin-top: 7px; color: var(--olive-dark); font-size: 12px; }
.property-list-card { margin-top: 0; }
.clickable-property-row td { padding: 0; }
.clickable-property-row td>a { min-height: 52px; padding: 14px 16px; display: flex; align-items: center; color: inherit; text-decoration: none; }
.clickable-property-row:hover td { background: #f0f4ff; }
.clickable-property-row td>a:focus { outline: 3px solid #dbe5ff; outline-offset: -3px; }
.property-edit-card { margin-top: 0; }
.property-edit-card input[readonly] { color: #5f686c; background: #eef1ee; }
.client-list-card { margin-top: 0; }
.clickable-client-row td { padding: 0; }
.client-row-link { min-height: 58px; padding: 14px 16px; display: flex; align-items: center; color: inherit; text-decoration: none; }
.clickable-client-row { cursor: pointer; }
.clickable-client-row:hover td { background: #f0f4ff; }
.clickable-client-row:focus-visible { outline: 3px solid #dbe5ff; outline-offset: -3px; }
.client-row-link:hover { color: inherit; }
.client-row-link:focus:not(:focus-visible) { outline: none; }
.client-row-link:focus-visible { outline: 3px solid #dbe5ff; outline-offset: -3px; }
.client-name-link { font-size: 15px; }
.client-exit-date { margin-top: 9px; display: block; color: #b22238; font-weight: 750; }
.lease-list-card { margin-top: 0; }
main>h1 { margin-bottom: 24px; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.15px; }
.summary-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 26px; margin-bottom: 28px; }
.summary-card { min-height: 160px; padding: 25px 24px 21px; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--olive-line); border-radius: 5px; }
.summary-card span { color: #566069; font-size: 16px; font-weight: 600; }
.summary-card strong { margin: 8px 0 3px; color: #15191b; font-size: 48px; line-height: 1; letter-spacing: -2px; }
.summary-card strong.olive { color: var(--olive-dark); }
.summary-card small { margin-top: auto; color: var(--muted); font-size: 15px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,3fr) minmax(270px,1fr); gap: 20px; }
.panel,.card { background: #fff; border: 1.5px solid var(--olive-line); border-radius: 5px; }
.panel { min-height: 420px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px 15px; }
.panel-heading a { color: var(--olive-dark); font-size: 13px; text-decoration: none; }
.table-wrap { padding: 0 20px 22px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th,td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #dfe3e0; vertical-align: middle; }
th { color: #171b1d; background: #eff1ef; font-size: 13px; font-weight: 700; text-transform: none; }
tr:last-child td { border-bottom: 0; }
.amount { text-align: right; white-space: nowrap; }
.amount.due { color: #9b2435; font-weight: 700; }
.muted { color: #8a9296; }
.mobile-detail { display: none; }
.status-pill,.badge { display: inline-flex; min-width: 92px; justify-content: center; padding: 6px 15px; border-radius: 999px; background: #edf0ee; color: #344035; font-size: 13px; }
.status-pill.occupied,.badge.payee { background: var(--olive-pale); color: #2448b5; }
.status-pill.free { background: #edf0ee; color: #3e4b41; }
.badge.en_retard { background: #ffe2e6; color: #8f1830; }
.badge.partielle { background: #fff0cf; color: #7d5a06; }
.badge.en_cours { background: var(--olive-pale); color: #2448b5; }
.badge.terminee { background: #e5e8e9; color: #465055; }
.badge.a_venir { background: #fff0cf; color: #7d5a06; }
.empty-state { padding: 48px 16px; color: var(--muted); text-align: center; }
.empty-state a { color: var(--olive-dark); }
.alerts-panel { padding-bottom: 20px; }
.alert-item { margin: 0 20px 12px; min-height: 78px; padding: 14px 14px 14px 16px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px; background: var(--danger-pale); border-radius: 5px; text-decoration: none; }
.alert-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--danger); }
.alert-item strong,.alert-item small { display: block; }
.alert-item strong { margin-bottom: 3px; font-size: 14px; }
.alert-item small { color: #61696d; font-size: 12px; line-height: 1.5; }
.chevron { color: #596164; font-size: 25px; line-height: 1; }
.no-alert { margin: 0 20px; padding: 18px; display: flex; gap: 13px; align-items: center; background: #eef3ff; color: var(--olive-dark); }
.no-alert>span { font-size: 22px; }
.no-alert p { margin: 0; }
.no-alert strong,.no-alert small { display: block; }
.no-alert small { margin-top: 4px; color: var(--muted); }
.revision-note { margin: 22px 20px 0; padding-top: 17px; display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--line); font-size: 13px; }
.revision-note a { color: var(--olive-dark); }

/* Annual payment matrix */
.matrix-page-heading { align-items: end; }
.dashboard-controls { display: flex; align-items: end; gap: 10px; }
.dashboard-export { white-space: nowrap; }
.matrix-year-picker label { min-width: 118px; }
.matrix-year-picker select { min-width: 118px; }
.matrix-panel { min-height: 0; overflow: hidden; }
.matrix-toolbar { min-height: 86px; padding: 20px 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.matrix-toolbar h2 { margin-bottom: 5px; }
.matrix-toolbar small { font-size: 12px; }
.matrix-legend { display: flex; align-items: center; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.matrix-legend span { display: inline-flex; align-items: center; gap: 7px; color: #30373a; font-size: 12px; white-space: nowrap; }
.legend-swatch { width: 22px; height: 22px; display: inline-block; border: 1px solid rgba(35,42,45,.08); border-radius: 3px; }
.legend-swatch.paid,.state-paid { background: #dcebb9; }
.legend-swatch.unpaid,.state-unpaid { background: #f6cfcd; }
.legend-swatch.free,.state-free { background: #e5e8e9; }
.matrix-scroll { max-height: calc(100vh - 190px); min-height: 430px; overflow-x: hidden; overflow-y: auto; border-top: 1px solid #dfe3e0; scrollbar-gutter: stable; }
.matrix-scroll:focus { outline: 3px solid #dbe5ff; outline-offset: -3px; }
.annual-payment-matrix { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 1px; background: #fff; table-layout: fixed; }
.annual-payment-matrix th,.annual-payment-matrix td { height: 38px; padding: 5px 3px; border: 0; text-align: center; font-variant-numeric: tabular-nums; overflow: hidden; }
.annual-payment-matrix .clickable-head,.annual-payment-matrix .matrix-cell,.annual-payment-matrix .clickable-total { padding: 0; }
.matrix-head-link,.matrix-cell-link { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: inherit; text-decoration: none; }
.matrix-head-link { padding: 6px 3px; font-weight: inherit; }
.property-head-link { justify-content: flex-start; padding-left: 10px; }
.matrix-cell-link { padding: 5px 2px; }
.matrix-head-link:hover,.matrix-head-link:focus,.matrix-cell-link:hover,.matrix-cell-link:focus { background: rgba(65,105,225,.1); outline: 2px solid rgba(65,105,225,.3); outline-offset: -2px; }
.matrix-property-link,.matrix-free-link { color: inherit; text-decoration: none; }
.matrix-property-link:hover,.matrix-property-link:focus,.matrix-free-link:hover,.matrix-free-link:focus { color: var(--olive-dark); text-decoration: underline; }
.annual-payment-matrix thead th { position: sticky; top: 0; z-index: 4; height: 44px; background: #f1f3f2; box-shadow: 0 1px 0 #cfd5d1; }
.annual-payment-matrix .property-column { width: 18%; min-width: 0; position: sticky; left: 0; padding-left: 10px; text-align: left; }
.annual-payment-matrix thead .property-column { z-index: 7; }
.annual-payment-matrix tbody .property-column { z-index: 2; background: #fff; box-shadow: 1px 0 0 #dfe3e0; }
.annual-payment-matrix .property-column strong { margin-right: 5px; }
.annual-payment-matrix .property-column span { color: #475055; font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.matrix-tenants a { color: #2448b5; font-weight: 700; text-decoration: none; }
.matrix-tenants a:hover,.matrix-tenants a:focus { color: var(--olive-dark); text-decoration: underline; }
.matrix-tenants b { color: #8a9296; font-weight: 400; }
.matrix-cell { color: #273035; font-size: clamp(8px,.83vw,12px); font-weight: 650; white-space: nowrap; }
.matrix-cell.state-paid { color: #2448b5; }
.matrix-cell.state-unpaid { color: #a5221a; }
.matrix-cell.state-free { color: #526067; font-weight: 600; }
.annual-payment-matrix .annual-column,.annual-payment-matrix .annual-total,.annual-payment-matrix .grand-total { width: 8.5%; min-width: 0; position: sticky; right: 0; }
.annual-payment-matrix .annual-column { z-index: 7; }
.annual-total { z-index: 3; color: #202629; background: #f0f2f1; font-weight: 800; box-shadow: -1px 0 0 #cfd5d1; }
.annual-payment-matrix tfoot th,.annual-payment-matrix tfoot td { position: sticky; bottom: 0; z-index: 5; color: #1e2528; background: #f1efeb; font-size: 12px; font-weight: 800; box-shadow: 0 -1px 0 #c8cfca; }
.annual-payment-matrix tfoot .property-column { z-index: 8; color: #fff; background: #4b5353; }
.annual-payment-matrix tfoot .grand-total { z-index: 8; color: var(--olive-dark); background: #f3f1eb; outline: 2px solid var(--olive-dark); outline-offset: -2px; font-size: 14px; }
.card { padding: 22px; margin: 18px 0; }
.card h2 { margin-bottom: 18px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 14px; align-items: end; }
.contract-prepare-card { margin-top: 0; }
.contract-prepare-intro { margin-bottom: 18px; }
.contract-prepare-intro p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.contract-prepare-card .wide-field,.form-section-title { grid-column: 1/-1; }
.client-lease-edit-card { margin-top: 20px; }
.client-lease-edit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-section-title { margin: 8px 0 0; padding-bottom: 7px; color: var(--olive-dark); border-bottom: 1px solid var(--line); font-size: 15px; }
label { display: flex; flex-direction: column; gap: 7px; color: #3f474b; font-size: 13px; font-weight: 650; }
.check { flex-direction: row; align-items: center; }
input,select,textarea,button { min-height: 42px; padding: 9px 11px; color: #202629; background: #fff; border: 1px solid #cbd2cc; border-radius: 4px; font: inherit; }
input:focus,select:focus,textarea:focus { outline: 3px solid #dbe5ff; border-color: var(--olive); }
.uppercase-input { text-transform: uppercase; }
textarea { min-height: 80px; resize: vertical; }
button,.btn { min-height: 42px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--anthracite); border: 0; border-radius: 4px; cursor: pointer; text-decoration: none; }
button:hover,.btn:hover { background: #2448b5; color: #fff; }
.btn.secondary { color: #2448b5; background: #edf2ff; border: 1px solid #c4d1f5; }
.btn.secondary:hover { background: #d5dfff; color: #1e3f9c; border-color: #a7baf2; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }
details { margin-top: 8px; }
details form { min-width: 220px; margin-top: 8px; display: grid; gap: 7px; }
.login { max-width: 430px; margin-top: 70px; }
.login .card { padding: 32px; }
.login h1 { font-size: 29px; }
.login button { margin-top: 14px; width: 100%; }
.alert { padding: 11px; color: #8d1930; background: #ffe5e8; border-radius: 4px; }
.success-note { padding: 12px 15px; color: #2448b5; background: #edf2ff; border-left: 4px solid var(--olive); }
.info-note { margin: 18px 0 0; padding: 11px 14px; color: #4e585c; background: #f1f3f1; border-left: 3px solid var(--olive-line); font-size: 13px; }
.block-note { display: block; margin-top: 6px; }
.text-link { color: var(--olive-dark); text-decoration: none; }
.panel-heading.compact { padding: 0 0 16px; }
.table-wrap.flush { padding: 0; }

/* Per-client document space */
.document-heading { align-items: center; }
.heading-actions,.client-actions { display: flex; align-items: center; gap: 12px; }
.heading-actions { justify-content: flex-end; flex-wrap: wrap; }
.client-actions { min-width: 190px; }
.client-actions .btn { min-width: 88px; }
.client-edit-card { margin-top: 0; }
.invoice-type-buttons { margin: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.billing-tabs { margin: -8px 0 22px; display: inline-flex; gap: 5px; padding: 4px; background: #e9efff; border: 1px solid #c4d1f5; border-radius: 6px; }
.billing-tabs a { min-width: 130px; padding: 10px 18px; color: #3c507e; border-radius: 4px; font-weight: 700; text-align: center; text-decoration: none; }
.billing-tabs a:hover { background: #f6f8ff; }
.billing-tabs a.active { color: #fff; background: var(--olive-dark); }
.invoice-type-button { min-height: 64px; padding: 14px 18px; justify-content: space-between; font-size: 17px; }
.invoice-type-button b { min-width: 30px; padding: 5px 9px; color: var(--anthracite); background: #fff; border-radius: 99px; font-size: 13px; text-align: center; }
.invoice-type-button.active { background: var(--olive-dark); }
.invoice-section { padding: 0; overflow: hidden; }
.invoice-section-heading { min-height: 62px; padding: 17px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.invoice-section-heading h2 { margin: 0; }
.invoice-section-heading span { min-width: 27px; padding: 4px 8px; color: var(--olive-dark); background: #edf2ff; border-radius: 99px; font-size: 12px; text-align: center; }
.invoice-section.unpaid .invoice-section-heading span { color: #8f1830; background: #ffe2e6; }
.invoice-actions { min-width: 170px; }
.invoice-actions > .btn { margin-bottom: 5px; }
.document-section { margin: 0 0 20px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.section-title { min-height: 58px; padding: 15px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.section-title span { min-width: 25px; padding: 3px 7px; color: var(--olive-dark); background: #edf2ff; border-radius: 99px; font-size: 12px; text-align: center; }
.document-row { min-height: 72px; padding: 12px 18px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; border-bottom: 1px solid #e7eae7; text-decoration: none; }
.document-row:last-child { border-bottom: 0; }
.document-row:hover { background: #f0f4ff; }
.document-row strong,.document-row small { display: block; }
.document-row .contract-incomplete { margin-top: 4px; color: #a02438; font-weight: 700; }
.document-row small { margin-top: 4px; }
.identity-upload-form { padding: 14px 18px; display: grid; grid-template-columns: minmax(240px,1fr) auto; gap: 10px 14px; align-items: end; border-top: 1px solid #e7eae7; }
.identity-upload-form label { margin: 0; }
.identity-upload-form small { grid-column: 1 / -1; }
.document-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #7c2936; background: #fbe8eb; border-radius: 4px; font-size: 10px; font-weight: 800; }
.document-icon.olive-file { color: var(--olive-dark); background: #e8efff; }
.document-action { color: var(--olive-dark); font-size: 13px; }
.empty-document { margin: 0; padding: 22px 18px; color: var(--muted); }
.client-management-row { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e7eae7; }
.client-management-row:last-child { border-bottom: 0; }
.client-management-row strong,.client-management-row small { display: block; }
.client-management-row small { margin-top: 4px; }
.client-indexation-status { color: var(--olive-dark); font-weight: 700; }
.client-management-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.client-management-actions .btn { min-height: 36px; padding: 7px 10px; font-size: 12px; }

/* Annual management and CR tax sheet */
.annual-heading { align-items: center; }
.year-picker label { min-width: 130px; }
.annual-summary { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 18px; }
.annual-summary article { min-height: 142px; padding: 22px; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--olive-line); border-radius: 5px; }
.annual-summary span { color: #566069; font-size: 14px; font-weight: 650; }
.annual-summary strong { margin: 9px 0; font-size: 34px; letter-spacing: -1px; }
.annual-summary small { margin-top: auto; line-height: 1.45; }
.annual-summary .exports-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; }
.exports-card span { grid-column: 1/-1; }
.exports-card .btn { min-width: 92px; }
.fiscal-note { margin-bottom: 20px; }
.icc-source-note { margin-bottom: 18px; }
.expense-entry details { margin: 0; }
.expense-entry summary { color: var(--olive-dark); font-weight: 750; cursor: pointer; }
.expense-entry form { margin-top: 18px; }
.annual-tables { display: grid; grid-template-columns: 1fr; gap: 2px; }
.annual-tables .card { margin-bottom: 0; }
.expense-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.expense-summary article { min-height: 132px; padding: 20px; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--olive-line); border-radius: 5px; }
.expense-summary span { color: #566069; font-size: 14px; font-weight: 650; }
.expense-summary strong { margin: 9px 0; font-size: 31px; letter-spacing: -1px; }
.expense-summary small { margin-top: auto; }
.expense-list-card { margin-top: 0; }
.history-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
.history-summary article { min-height: 104px; padding: 18px 20px; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--olive-line); border-radius: 5px; }
.history-summary span { color: #566069; font-size: 13px; font-weight: 650; }
.history-summary strong { margin-top: 8px; font-size: 28px; }
.history-summary.former-tenants-summary { grid-template-columns: minmax(240px,360px); }
.history-table-card { margin-top: 0; }
.history-number { color: var(--olive-dark); font-size: 16px; }
.payment-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.payment-summary article { min-height: 112px; padding: 19px 20px; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--olive-line); border-radius: 5px; }
.payment-summary span { color: #566069; font-size: 13px; font-weight: 650; }
.payment-summary strong { margin-top: 8px; font-size: 29px; }
.payment-entry { margin-top: 0; }
.payment-entry details { margin: 0; }
.payment-entry summary { color: var(--olive-dark); font-weight: 750; cursor: pointer; }
.payment-entry form { margin-top: 18px; }
.payment-list-card { margin-top: 0; }
.settings-card { max-width: 920px; margin-top: 0; }
.settings-card-intro { margin-bottom: 22px; }
.settings-card-intro h2 { margin-bottom: 5px; }
.settings-card-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.settings-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.settings-form .wide-field,.settings-submit { grid-column: 1/-1; }
.settings-submit { padding-top: 5px; }
.settings-submit button { min-width: 230px; }

/* Universal document preview */
.preview-heading { align-items: center; margin-bottom: 12px; }
.preview-heading p { overflow-wrap: anywhere; }
.preview-back { white-space: nowrap; }
.document-toolbar { margin-bottom: 12px; padding: 10px; display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.preview-action { min-width: 126px; justify-content: center; text-align: center; }
.preview-action.active { color: #fff; background: var(--olive-dark); border-color: var(--olive-dark); }
.document-viewer { min-height: calc(100vh - 175px); overflow: hidden; background: #e8ebe8; border: 1px solid #cbd1cc; border-radius: 5px; }
.document-viewer.pdf { padding: 22px; overflow: auto; }
.pdf-pages { display: grid; justify-items: center; gap: 22px; }
.pdf-pages figure { width: min(100%,900px); margin: 0; }
.pdf-pages img { width: 100%; height: auto; display: block; background: #fff; box-shadow: 0 5px 25px rgba(30,36,32,.18); }
.pdf-pages figcaption { padding: 7px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.pdf-native { width: 100%; min-height: calc(100vh - 225px); border: 0; background: #fff; }
.document-viewer.image { padding: 28px; display: grid; place-items: start center; overflow: auto; }
.document-viewer.image img { max-width: 100%; height: auto; display: block; background: #fff; box-shadow: 0 5px 25px rgba(30,36,32,.14); }
.document-viewer.spreadsheet { padding: 18px; overflow: auto; background: #f3f5f2; }
.spreadsheet-sheet { margin-bottom: 20px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.spreadsheet-sheet:last-child { margin-bottom: 0; }
.spreadsheet-sheet h2 { margin-bottom: 12px; }
.spreadsheet-scroll { overflow: auto; }
.spreadsheet-scroll table { width: max-content; min-width: 100%; font-size: 12px; }
.spreadsheet-scroll th,.spreadsheet-scroll td { min-width: 92px; padding: 8px 10px; white-space: nowrap; }
.unsupported-preview { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 12px; }
.unsupported-preview p { color: var(--muted); }
small { color: var(--muted); }
@media(max-width:1050px){.history-summary{grid-template-columns:1fr 1fr}}
@media(max-width:1050px){.dashboard-grid{grid-template-columns:1fr}.alerts-panel{min-height:0}.annual-summary{grid-template-columns:1fr 1fr}.annual-summary .exports-card{grid-column:1/-1}.expense-summary{grid-template-columns:1fr 1fr}.expense-summary article:first-child{grid-column:1/-1}.client-management-row{align-items:flex-start;flex-direction:column}.client-management-actions{justify-content:flex-start}}
@media(max-width:720px){.topbar{width:100%;min-height:58px;padding:8px 10px;position:sticky;inset:0 0 auto;display:flex;flex-direction:row;align-items:center;gap:6px;border-right:0;border-bottom:1px solid #b7c7f3}.topbar .brand{width:42px;font-size:0;flex:none}.topbar .brand::after{content:"B&G";font-size:15px}.main-nav{width:auto;margin:0;flex:1;flex-direction:row;gap:2px;overflow-x:auto}.nav-link{padding:9px 8px;font-size:12px}.nav-link::after{top:auto;right:6px;bottom:2px;left:6px;width:auto;height:2px}.topbar-actions{width:auto;margin:0;display:flex;gap:4px}.settings-menu>summary,.notification-menu>summary{width:38px;min-height:36px;padding:7px;justify-content:center;font-size:0}.notification-menu>summary::before{content:"🔔";font-size:14px}.settings-menu>summary::before{content:"⚙";font-size:16px}.notification-badge{position:absolute;top:-5px;right:-4px}.settings-popover,.notification-popover{width:min(340px,calc(100vw - 20px));position:fixed;top:62px;right:10px;bottom:auto;left:auto}.settings-form{grid-template-columns:1fr}.settings-form .wide-field,.settings-submit{grid-column:auto}main{min-height:calc(100vh - 58px);margin-left:0;padding:18px 12px 40px}.page-heading{align-items:flex-end}.page-heading h1,main>h1{font-size:24px}.page-heading p{font-size:13px}.page-heading time{display:none}.dashboard-controls{align-items:stretch;flex-direction:column}.dashboard-export{min-height:38px;padding:8px 10px}.creation-disclosure,.creation-disclosure.is-open{width:100%;margin-left:0}.create-toggle,.creation-disclosure.is-open .create-toggle{width:100%;margin-left:0}.property-search-card{align-items:stretch;flex-direction:column;gap:18px}.property-search-form{min-width:0;width:100%}.search-controls{grid-template-columns:1fr}.search-controls button{width:100%}.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.summary-card{min-height:124px;padding:16px 12px}.summary-card span{font-size:12px}.summary-card strong{font-size:36px}.summary-card small{font-size:11px}.panel-heading{padding:18px 16px 13px}.panel-heading a{display:none}.table-wrap{padding:0 10px 15px}th,td{padding:13px 8px}.dashboard-table th:nth-child(2),.dashboard-table td:nth-child(2){display:none}.status-pill{min-width:72px;padding:5px 9px}.formgrid{grid-template-columns:1fr}.card{padding:16px;overflow-x:auto}.matrix-page-heading{align-items:flex-end}.matrix-toolbar{align-items:flex-start;flex-direction:column}.matrix-legend{justify-content:flex-start}.matrix-scroll{max-height:calc(100vh - 275px);min-height:410px}.annual-payment-matrix .property-column{width:18%;padding-left:5px}.annual-payment-matrix .annual-column,.annual-payment-matrix .annual-total,.annual-payment-matrix .grand-total{width:9%}.annual-payment-matrix th,.annual-payment-matrix td{height:34px;padding:4px 1px;font-size:8px}.annual-payment-matrix .property-column strong{display:block;font-size:10px}.annual-payment-matrix .property-column span{display:block;font-size:8px;line-height:1.15}.annual-payment-matrix tfoot th,.annual-payment-matrix tfoot td{font-size:8px}.annual-payment-matrix tfoot .grand-total{font-size:9px}}
@media(max-width:440px){.summary-grid{grid-template-columns:1fr}.summary-card{min-height:108px}}
@media(max-width:620px){.invoice-type-buttons{grid-template-columns:1fr}.billing-tabs{width:100%;display:grid;grid-template-columns:1fr 1fr}.billing-tabs a{min-width:0}.annual-summary{grid-template-columns:1fr}.annual-summary .exports-card{grid-column:auto}.document-row{grid-template-columns:42px 1fr}.document-action{display:none}.annual-heading{align-items:stretch;flex-direction:column}.expense-summary,.history-summary,.payment-summary{grid-template-columns:1fr}.expense-summary article:first-child{grid-column:auto}}
@media(max-width:620px){.identity-upload-form{grid-template-columns:1fr}.identity-upload-form small{grid-column:auto}}
@media(max-width:620px){.preview-heading{align-items:flex-start;flex-direction:column}.document-toolbar{display:grid;grid-template-columns:1fr 1fr 1fr}.preview-action{min-width:0;padding:8px 5px;font-size:11px}.document-viewer.pdf{padding:8px}.document-viewer.spreadsheet{padding:8px}.spreadsheet-sheet{padding:10px}}
@media(max-width:720px){.topbar .brand{width:50px;font-size:10px;line-height:1;flex:none}.topbar .brand::after{content:none}.topbar .brand span:last-child{font-size:14px}}
@media(max-width:720px){.topbar .brand-row{width:auto;flex:none;gap:5px}.topbar .brand-add-button{width:40px;height:40px;flex-basis:40px;border-radius:6px;font-size:29px}}
@media print {
  .topbar,.preview-heading,.document-toolbar { display:none !important; }
  main { min-height:0; margin:0; padding:0; }
  .document-viewer { min-height:0; overflow:visible; background:#fff; border:0; }
  .document-viewer.image { padding:0; }
  .document-viewer.image img { max-width:100%; box-shadow:none; }
  .document-viewer.pdf { padding:0; overflow:visible; }
  .pdf-pages { display:block; }
  .pdf-pages figure { width:100%; break-after:page; }
  .pdf-pages img { width:100%; box-shadow:none; }
  .pdf-pages figcaption { display:none; }
  .document-viewer.spreadsheet { padding:0; overflow:visible; }
  .spreadsheet-sheet { break-after:page; border:0; }
  .spreadsheet-scroll { overflow:visible; }
}

/* Client file: identity, rental management, then all documents. */
.client-info-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;padding:22px;margin:0; }
.client-info-grid dt { font-weight:700;color:var(--muted,#63708b);font-size:12px;margin-bottom:6px; }
.client-info-grid dd { margin:0;font-size:15px;overflow-wrap:anywhere; }
.preserve-lines { white-space:pre-line; }
.client-notes { grid-column:1/-1; }
.section-edit { margin-left:auto; }
.document-intro { padding:0 20px;color:#63708b; }
.client-document-upload { display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;padding:20px;background:#f5f7ff;margin:16px 20px 24px;border-radius:6px; }
.client-document-upload label { flex:1;min-width:180px; }
.client-document-upload small { display:block;margin-top:6px; }
.client-document-category { margin:0 20px 24px;border:1px solid var(--line);border-radius:5px;overflow:hidden; }
.client-document-category h3 { margin:0; }
.client-document-category .section-title { background:#f5f7ff; }
@media(max-width:700px) { .client-info-grid { grid-template-columns:1fr;gap:16px; }.section-edit{margin-left:0}.section-title{flex-wrap:wrap}.client-document-upload{margin:12px}.client-document-category{margin:0 12px 18px} }
.document-category-buttons { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:20px; }
.document-category-button { padding:18px 12px;background:#fff;color:var(--olive-dark,#2448b5);border:1px solid #c9d4f0;border-radius:6px;font-weight:600;font-size:15px; }
.document-category-button:hover { background:#f0f4ff;border-color:#4169e1; }
.document-category-button:focus-visible,.dialog-close:focus-visible { outline:3px solid #a7baf2;outline-offset:3px; }
.documents-dialog { width:min(680px,calc(100vw - 32px));max-height:85vh;box-sizing:border-box;padding:0;border:1px solid #dce3f2;border-radius:12px;color:#293033;background:#fff;box-shadow:0 20px 70px #0003; }
.documents-dialog::backdrop { background:rgba(24,37,70,.42); }
.documents-dialog-header { display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid #e5eaf5; }
.documents-dialog-header h2 { margin:0;font-size:21px; }
.dialog-close { border:0;background:transparent;color:#4e6086;padding:4px 10px;font-size:28px;line-height:1; }
.documents-dialog-list { max-height:45vh;overflow:auto; }
.documents-dialog .document-row { display:flex;gap:14px;padding:18px 24px;align-items:center; }
.documents-dialog .document-row>span:nth-child(2) { flex:1;min-width:0;overflow-wrap:anywhere; }
.documents-dialog .document-row>small { display:none; }
.documents-dialog-footer { padding:20px 24px;background:#f6f8ff;border-top:1px solid #e5eaf5; }
.documents-dialog-footer form { display:grid;grid-template-columns:1fr auto;gap:10px 16px;align-items:end; }
.document-file-picker { grid-column:1/-1; }
.documents-dialog-footer small { color:#63708b; }
.documents-dialog .success-note,.documents-dialog .alert { margin:16px 24px; }
@media(max-width:600px) { .document-category-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}.documents-dialog .document-row{padding:14px;flex-wrap:wrap}.documents-dialog-header,.documents-dialog-footer{padding:16px}.documents-dialog .document-action{font-size:12px} }

.client-management-row .rental-summary-bold { font-weight:700; }
.client-management-row .rental-indexation-plain { font-weight:400;font-style:normal;color:inherit;background:none;border:0;padding:0; }
.expense-search-controls { display:flex;align-items:flex-start;gap:18px;flex:1;justify-content:flex-end; }
.expense-search-controls .property-search-form { flex:1;max-width:420px; }
.expense-search-controls .year-picker { min-width:100px; }
.expense-list-heading { display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 20px;border-bottom:1px solid var(--line); }
.expense-list-heading h2 { font-size:17px;margin:0; }
.expense-list-heading>span { font-size:13px;color:#63708b; }
.expense-list-heading strong { color:#293033;font-size:17px;margin-left:8px; }
.expense-totals-note { padding:14px 20px;border-top:1px solid var(--line);color:#63708b;font-size:12px; }
.expense-totals-note span { margin:0 10px; }
@media(max-width:700px) { .expense-search-controls{width:100%;justify-content:flex-start}.expense-list-heading{align-items:flex-start;flex-direction:column}.expense-search-card{flex-direction:column;align-items:stretch} }

/* Wrap expense filters according to available panel width. */
.expense-search-card { flex-wrap:wrap;align-items:flex-start; }
.expense-search-card > div:first-child { flex:1 1 220px;min-width:0; }
.expense-search-controls { display:flex;flex-wrap:wrap;flex:2 1 400px;min-width:0;max-width:100%;gap:16px;align-items:flex-start;justify-content:flex-start; }
.expense-search-controls .year-picker { flex:1 1 140px;min-width:0;margin:0; }
.expense-search-controls .property-search-form { flex:2 1 240px;min-width:0;max-width:none;width:auto;margin:0; }
.expense-search-controls label { display:block;min-width:0;margin:0 0 6px;font-size:13px;font-weight:600;line-height:1.4; }
.expense-search-controls .year-picker label { margin-bottom:0; }
.expense-search-controls input,.expense-search-controls select { display:block;box-sizing:border-box;width:100%;min-width:0;height:44px;padding:10px 12px;border:1px solid #cbd2cc;border-radius:4px;background:#fff;color:#202629;font-size:14px;font-weight:400;line-height:1.4; }
.expense-search-controls select { margin-top:6px; }
.expense-search-controls .live-search-status:empty { display:none; }
@media(max-width:700px) { .expense-search-controls { flex:initial;width:100%; }.expense-search-card > div:first-child { flex:initial; } }

/* Expense filters always sit below the search heading. */
.expense-search-card { flex-direction:column;align-items:stretch;gap:18px; }
.expense-search-card > div:first-child { flex:none; }
.expense-search-card .expense-search-controls { flex:none;width:100%; }
.brand-add-menu { position:relative;flex:none; }
.brand-add-menu summary { list-style:none;cursor:pointer; }
.brand-add-menu summary::-webkit-details-marker { display:none; }
.brand-add-popover { position:absolute;top:calc(100% + 8px);left:0;z-index:100;width:180px;padding:6px;background:#fff;border:1px solid #d4ddf3;border-radius:8px;box-shadow:0 8px 24px #0002; }
.brand-add-popover a { display:block;padding:12px;color:#293033;text-decoration:none;border-radius:4px;font-size:14px;white-space:nowrap; }
.brand-add-popover a:hover,.brand-add-popover a:focus-visible { background:#edf2ff; }

.client-add-layout { display:block;width:100%; }
.client-add-layout .creation-disclosure.is-open { width:100%;max-width:none;margin:0; }
.client-add-layout #add-client-form { width:100%;max-width:none;box-sizing:border-box; }

.client-form-bottom-actions { display:flex;justify-content:flex-end;margin-top:20px; }

.client-form-top-actions { display:flex;justify-content:flex-end;margin-bottom:16px; }
label[data-organisation-field][hidden] { display:none !important; }

.client-paired-fields { grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start; }
.client-paired-fields label { min-width:0; }
.client-payment-notes select,.client-payment-notes .client-compact-notes { box-sizing:border-box;height:42px;min-height:42px; }
.client-payment-notes .client-compact-notes { resize:vertical; }
@media(max-width:720px) { .client-paired-fields { grid-template-columns:1fr; } }

/* Compact dashboard rows, with availability beside the property number only. */
.matrix-scroll { min-height:0; }
.annual-payment-matrix tbody th,.annual-payment-matrix tbody td { height:24px;padding:2px 3px;line-height:1.15; }
.annual-payment-matrix tbody .matrix-cell,.annual-payment-matrix tbody .clickable-total { padding:0; }
.annual-payment-matrix tbody .matrix-cell-link { box-sizing:border-box;min-height:24px;padding:2px; }
.annual-payment-matrix tbody .property-column { white-space:nowrap; }
.annual-payment-matrix tbody .property-column strong,.annual-payment-matrix tbody .property-column .matrix-free-label { display:inline; }
.annual-payment-matrix tbody .property-column .matrix-tenants { display:inline;white-space:nowrap; }
.annual-payment-matrix tbody .state-paid { color:#286320; }
.annual-payment-matrix tbody .state-unpaid { color:#b42318; }

.rental-payment-button { margin-left:auto; }
.client-management-section .client-management-row { flex-direction:row;align-items:center; }
.client-management-section .client-management-row>div:first-child { flex:1;min-width:0; }
.client-management-section .client-management-actions { flex-shrink:0;margin-left:auto; }
.contract-document-entry { border-bottom:1px solid #e5eaf5; }
.contract-document-entry .document-row { border-bottom:0; }
.contract-edit-action { display:inline-block;margin:0 24px 16px; }
@media(max-width:480px) { .client-management-section .client-management-row{gap:10px}.client-management-section .client-management-actions .btn{padding:8px;font-size:12px}.rental-payment-button{margin-left:0} }

/* Payment status retains its green/red meaning in the dashboard. */
.annual-payment-matrix .matrix-cell.state-paid { background:#dcebb9;color:#286320; }
.matrix-legend .legend-swatch.paid { background:#dcebb9; }

button:focus-visible,.btn:focus-visible { outline:3px solid #a7baf2;outline-offset:3px; }
.dialog-close:hover { background:#e5ebff;color:#2448b5; }
.document-category-button:hover { color:#2448b5; }
.creation-disclosure.is-open .create-toggle:hover { background:#1e3f9c; }

.topbar .brand-add-button { width:34px;height:34px;min-height:34px;flex:0 0 34px;padding:0;border-radius:5px;font-size:24px;font-weight:300; }

.brand-row .brand-add-menu { align-self:flex-end;margin-bottom:9px; }

.topbar .brand-add-button { background:#243452;border-color:#243452; }
