:root {
    --pine: #174a3d;
    --pine-deep: #10382f;
    --leaf: #c5dc83;
    --coral: #d96f5c;
    --sky: #dce9ed;
    --ink: #1b2824;
    --muted: #66736d;
    --paper: #f4f6f1;
    --white: #fff;
    --line: #dce2dc;
    --serif: "Newsreader", Georgia, serif;
    --sans: "DM Sans", sans-serif;
    --shadow: 0 12px 34px rgba(20, 49, 39, .08);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--sans); }
body { margin: 0; min-width: 320px; font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.04; }
h1 { font-size: 48px; }
h2 { font-size: 30px; }
h3 { font-size: 17px; }
em { color: var(--leaf); font-style: italic; }

.site-header { min-height: 76px; padding: 0 max(5vw, 24px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--pine); color: white; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: var(--pine-deep); background: var(--leaf); border-radius: 50% 50% 50% 8px; font-family: var(--serif); font-size: 21px; }
.brand-light { font-weight: 400; color: #d7e0d9; }
.main-nav { display: flex; align-items: center; justify-content: flex-end; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.main-nav > a:not(.button) { color: #e0ebe4; transition: color .18s ease; }
.main-nav > a:not(.button):hover { color: var(--leaf); }
.nav-logout { display: inline-flex; margin: 0; }
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 22px max(5vw, 24px); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid var(--pine); border-radius: 4px; background: var(--pine); color: white; font-weight: 700; font-size: 13px; transition: background .18s ease, transform .18s ease; }
.button:hover { background: var(--pine-deep); transform: translateY(-1px); }
.button-small { min-height: 36px; padding: 0 13px; font-size: 12px; }
.button-tiny { min-height: 30px; padding: 0 10px; font-size: 11px; }
.button-full { width: 100%; }
.button-quiet { min-height: 34px; padding: 0 10px; background: transparent; border-color: rgba(255,255,255,.28); }
.button-quiet:hover { background: rgba(255,255,255,.1); }
.button-outline { color: var(--pine); background: transparent; }
.button-outline:hover { color: white; }
.button-danger { background: var(--coral); border-color: var(--coral); }
.button-danger:hover { background: #bc594a; }

.search-band { padding: 50px max(5vw, 24px) 38px; color: white; background-color: var(--pine); background-image: repeating-linear-gradient(135deg, transparent 0, transparent 45px, rgba(255,255,255,.025) 45px, rgba(255,255,255,.025) 46px); display: grid; grid-template-columns: minmax(230px, .8fr) minmax(440px, 1.3fr); gap: 7vw; align-items: end; }
.search-copy { max-width: 390px; }
.search-copy h1 { margin-bottom: 16px; font-size: 54px; }
.search-copy p:last-child { color: #d0ded6; max-width: 330px; margin-bottom: 0; }
.eyebrow { margin-bottom: 9px; color: #6d8b7c; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.search-band .eyebrow { color: var(--leaf); }
.search-form { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 10px; }
.search-form label { color: #d7e3dc; font-size: 11px; }
.search-form input { margin-top: 5px; border-color: rgba(255,255,255,.23); background: rgba(255,255,255,.09); color: white; }
.search-form input::placeholder { color: #b3c5bb; }
.search-form .button { align-self: end; width: 100%; background: var(--leaf); border-color: var(--leaf); color: var(--pine-deep); }
.search-form .button:hover { background: #d2e69a; }
.listing-section { padding: 38px max(5vw, 24px) 15px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading .eyebrow { margin-bottom: 5px; }
.result-count { padding: 5px 10px; color: var(--pine); background: #e7eee6; font-size: 11px; font-weight: 700; white-space: nowrap; }
.house-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.house-card { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 5px; transition: box-shadow .2s ease, transform .2s ease; }
.house-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.house-image { display: block; position: relative; aspect-ratio: 1.55; overflow: hidden; background: var(--sky); }
.house-image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .4s ease; }
.house-card:hover .house-image img { transform: scale(1.035); }
.image-label { position: absolute; left: 12px; top: 12px; padding: 5px 8px; background: var(--leaf); color: var(--pine-deep); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.house-card-body { padding: 17px 18px 15px; }
.house-location { display: flex; gap: 8px; color: var(--muted); font-size: 11px; }
.house-location span + span::before { content: "·"; margin-right: 8px; color: var(--coral); }
.house-card h3 { margin: 8px 0 11px; font-family: var(--serif); font-size: 21px; font-weight: 500; }
.house-specs { display: flex; gap: 16px; color: var(--muted); font-size: 11px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.house-price { display: flex; align-items: baseline; gap: 5px; margin-top: 12px; }
.house-price strong { color: var(--pine); font-size: 17px; }
.house-price span { color: var(--muted); font-size: 11px; }
.empty-state { padding: 55px 20px; text-align: center; border: 1px dashed #c9d3ca; background: rgba(255,255,255,.45); }
.empty-state h3, .empty-state h2 { margin: 6px 0; }
.empty-state p { color: var(--muted); }
.empty-mark { display: inline-grid; place-items: center; min-width: 54px; height: 54px; margin-bottom: 10px; color: var(--pine); background: var(--leaf); border-radius: 50% 50% 50% 10px; font-family: var(--serif); font-size: 28px; }
.text-link { color: var(--pine); font-size: 12px; font-weight: 700; text-decoration: underline; text-decoration-color: #a9c1b4; text-underline-offset: 3px; }
.text-link:hover { color: var(--coral); }
.muted { color: var(--muted); }

.detail-wrap { padding: 30px max(7vw, 24px) 10px; max-width: 1320px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--pine); font-size: 12px; font-weight: 700; }
.detail-header { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 22px; }
.detail-header h1 { margin-bottom: 9px; }
.detail-header .muted { margin-bottom: 0; }
.detail-price { display: grid; text-align: right; white-space: nowrap; color: var(--pine); }
.detail-price strong { font-size: 23px; }
.detail-price span { color: var(--muted); font-size: 12px; }
.detail-gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 210px; gap: 8px; overflow: hidden; border-radius: 5px; }
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; background: var(--sky); }
.detail-gallery img:first-child { grid-column: span 2; grid-row: span 2; }
.detail-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 55px; margin-top: 38px; }
.detail-columns h2 { margin-bottom: 15px; }
.long-copy { max-width: 690px; line-height: 1.8; white-space: normal; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-facts div, .condition-line { display: grid; gap: 2px; }
.detail-facts span, .condition-line span { color: var(--muted); font-size: 11px; }
.detail-facts strong, .condition-line strong { color: var(--pine); }
.request-panel { padding: 22px; background: var(--white); border-top: 3px solid var(--leaf); box-shadow: var(--shadow); align-self: start; }
.request-panel h2 { font-size: 25px; }
.condition-line { grid-template-columns: 1fr auto; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stack-form { display: grid; gap: 12px; margin-top: 18px; }

.auth-layout { min-height: 570px; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(400px, 1.1fr); background: var(--pine); }
.auth-aside { padding: 90px max(5vw, 32px); color: white; background-image: repeating-linear-gradient(135deg, transparent 0, transparent 46px, rgba(255,255,255,.035) 46px, rgba(255,255,255,.035) 47px); }
.auth-aside h1 { max-width: 450px; font-size: 50px; }
.auth-aside > p:last-child { max-width: 390px; color: #d0ded6; }
.auth-form-wrap { padding: 70px 8vw; display: grid; align-content: center; background: var(--paper); }
.form-panel { width: 100%; max-width: 510px; margin: auto; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); }
.form-panel h2 { margin-bottom: 22px; }
label { display: grid; gap: 6px; color: #384840; font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #cfd8d1; border-radius: 3px; outline: none; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(23,74,61,.1); }
.form-panel > label, .form-panel > .form-grid, .form-panel > .landlord-fields, .form-panel > button { margin-bottom: 14px; }
.form-foot { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.form-foot a { color: var(--pine); font-weight: 700; text-decoration: underline; }
.register-layout { grid-template-columns: minmax(280px, .72fr) minmax(500px, 1.28fr); }
.register-form { max-width: 680px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-two { grid-column: span 2; }

.workspace-page { max-width: 1320px; margin: 0 auto; padding: 36px max(5vw, 24px) 10px; }
.narrow-page { max-width: 1000px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 25px; }
.page-heading h1 { margin: 0 0 8px; }
.page-heading p:last-child { margin-bottom: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric { min-height: 110px; padding: 18px; background: white; border: 1px solid var(--line); border-top: 3px solid #7b9c8c; display: flex; flex-direction: column; justify-content: space-between; }
.metric span { color: var(--muted); font-size: 11px; }
.metric strong { color: var(--pine); font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1; }
.metric-highlight { background: #eef3df; border-top-color: var(--leaf); }
.workspace-section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.workspace-section .section-heading { margin-bottom: 15px; }
.workspace-section .section-heading h2 { font-size: 25px; }
.dashboard-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.dashboard-columns .workspace-section { margin-top: 0; }
.compact-list { display: grid; }
.compact-row { min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.compact-row > div { display: grid; gap: 3px; }
.compact-row strong { font-size: 13px; }
.compact-row small { color: var(--muted); font-size: 11px; }
.status { display: inline-block; padding: 4px 8px; color: #3e6453; background: #e7efe9; font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.status-en_attente, .status-a_payer, .status-partielle { color: #805b17; background: #f7efda; }
.status-rejetee, .status-rejete, .status-annule { color: #954d43; background: #f8e8e4; }
.status-actif, .status-payee, .status-approuvee { color: #286149; background: #e3f0e7; }
.status-archivee, .status-termine, .status-ferme { color: #59645f; background: #e9ece9; }
.empty-inline { padding: 19px 0; color: var(--muted); }
.empty-inline a { color: var(--pine); text-decoration: underline; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 12px 14px; color: var(--muted); background: #edf1ec; font-size: 10px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #e8ece8; vertical-align: middle; }
td strong, td small { display: block; }
td strong { font-size: 12px; }
td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.property-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.table-thumb { width: 62px; height: 46px; object-fit: cover; background: var(--sky); }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.link-button { padding: 0; border: 0; background: none; color: var(--pine); font-size: 11px; font-weight: 700; text-decoration: underline; }
.danger-text { color: #a64d42; }
.photo-upload { min-width: 200px; margin-top: 9px; display: flex; align-items: end; gap: 7px; flex-wrap: wrap; }
.photo-upload label { font-size: 10px; }
.photo-upload input[type=file] { max-width: 160px; min-height: 30px; padding: 3px; font-size: 10px; }
.photo-upload .check-line { display: flex; align-items: center; gap: 5px; }
.photo-upload .check-line input { width: 14px; min-height: 14px; }
.property-form { max-width: none; }
.property-form label { margin-bottom: 14px; }

.review-list { display: grid; gap: 10px; }
.review-row, .request-row { padding: 18px; background: white; border: 1px solid var(--line); }
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; }
.review-main { display: flex; align-items: center; gap: 15px; min-width: 0; }
.review-main h3 { margin: 0 0 4px; }
.review-main p { margin: 2px 0; color: var(--muted); font-size: 11px; }
.review-main small { color: var(--muted); font-size: 10px; }
.review-index { display: grid; place-items: center; flex: 0 0 40px; height: 40px; color: var(--pine); background: var(--leaf); border-radius: 50%; font-weight: 700; font-size: 11px; }
.review-thumb { width: 105px; height: 78px; flex: 0 0 auto; object-fit: cover; }
.review-actions { display: flex; justify-content: end; align-items: end; flex-wrap: wrap; gap: 7px; max-width: 440px; }
.review-actions input { max-width: 190px; min-height: 36px; font-size: 11px; }
.inline-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.inline-form label { min-width: 180px; }
.request-row { border-left: 3px solid var(--leaf); }
.request-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.request-heading h2 { margin: 0 0 5px; font-size: 24px; }
.request-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.request-row blockquote { margin: 18px 0; padding: 12px 16px; border-left: 2px solid var(--sky); color: #465650; background: #f5f8f7; font-size: 13px; }
.request-row > small { color: var(--muted); font-size: 10px; }
.request-actions { display: flex; align-items: end; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.request-actions label { max-width: 220px; font-size: 10px; }
.request-actions input { min-height: 36px; font-size: 11px; }
.request-actions .reason-field { flex: 1 1 200px; }
.invoice-create, .ticket-create, .payment-entry { padding: 18px; background: #edf2ec; border: 0; }
.invoice-create { margin-bottom: 25px; }
.invoice-create .section-heading { margin-bottom: 13px; }
.invoice-sheet { padding: 26px; background: white; border: 1px solid var(--line); border-top: 4px solid var(--pine); }
.invoice-parties { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.invoice-parties div, .balance-grid div { display: grid; gap: 4px; }
.invoice-parties span, .balance-grid span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.invoice-parties strong { font-size: 12px; }
.invoice-total { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; }
.invoice-total span { color: var(--muted); font-size: 12px; }
.invoice-total strong { color: var(--pine); font-family: var(--serif); font-size: 30px; font-weight: 500; }
.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); }
.balance-grid strong { font-size: 15px; }
.form-note { color: var(--muted); font-size: 11px; margin: 12px 0 0; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 10px; }
.ticket-update { display: grid; grid-template-columns: minmax(180px, 1fr) 150px auto; align-items: end; gap: 10px; margin-top: 14px; }
.ticket-update label { font-size: 10px; }
.ticket-update textarea { min-height: 58px; }
.ticket-row > p { margin: 13px 0; }
.flash { position: relative; max-width: 1320px; margin: 14px auto 0; padding: 12px 46px 12px 16px; border-left: 4px solid var(--pine); background: #e6efe7; color: var(--pine-deep); font-size: 13px; }
.flash-error { border-left-color: var(--coral); background: #fae9e5; color: #773b32; }
.flash-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 22px; color: inherit; }
.page-empty { max-width: 700px; margin: 80px auto; }
.error-page { max-width: 640px; margin: 15vh auto; padding: 30px; }
.error-page h1 { font-size: 38px; }

@media (max-width: 980px) {
    .site-header { align-items: flex-start; padding-top: 16px; padding-bottom: 16px; }
    .main-nav { gap: 10px 14px; }
    .search-band { grid-template-columns: 1fr; gap: 28px; }
    .search-copy { max-width: none; }
    .search-copy h1 { font-size: 46px; }
    .house-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-layout, .register-layout { grid-template-columns: .8fr 1.2fr; }
    .auth-aside { padding: 70px 32px; }
    .auth-aside h1 { font-size: 42px; }
    .auth-form-wrap { padding: 48px 28px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .review-row { grid-template-columns: 1fr; }
    .review-actions { justify-content: flex-start; max-width: none; }
}
@media (max-width: 680px) {
    h1 { font-size: 38px; }
    h2 { font-size: 27px; }
    .site-header { display: block; }
    .brand { margin-bottom: 13px; }
    .main-nav { justify-content: flex-start; gap: 8px 14px; }
    .main-nav a { font-size: 11px; }
    .search-band { padding: 36px 20px 24px; }
    .search-copy h1 { font-size: 42px; }
    .search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-form .button { min-height: 42px; }
    .listing-section, .workspace-page { padding-left: 18px; padding-right: 18px; }
    .section-heading { align-items: start; }
    .house-grid { grid-template-columns: 1fr; gap: 14px; }
    .house-image { aspect-ratio: 1.65; }
    .detail-wrap { padding: 22px 18px 0; }
    .detail-header { align-items: start; flex-direction: column; gap: 10px; }
    .detail-price { text-align: left; }
    .detail-gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; }
    .detail-gallery img:first-child { grid-column: span 2; grid-row: span 1; }
    .detail-columns { grid-template-columns: 1fr; gap: 26px; margin-top: 28px; }
    .auth-layout, .register-layout { grid-template-columns: 1fr; }
    .auth-aside { padding: 38px 24px; }
    .auth-aside h1 { font-size: 38px; }
    .auth-form-wrap { padding: 24px 16px; }
    .form-panel { padding: 22px 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .span-two { grid-column: auto; }
    .metric-grid { gap: 8px; }
    .metric { min-height: 96px; padding: 13px; }
    .metric strong { font-size: 29px; }
    .dashboard-columns { grid-template-columns: 1fr; gap: 0; }
    .page-heading { align-items: start; flex-direction: column; }
    .page-heading h1 { font-size: 38px; }
    .review-row, .request-row { padding: 14px; }
    .review-thumb { width: 76px; height: 62px; }
    .review-main { align-items: flex-start; }
    .review-actions input { max-width: none; flex: 1 1 100%; }
    .request-actions { align-items: stretch; }
    .request-actions label { flex: 1 1 100%; max-width: none; }
    .invoice-parties { grid-template-columns: 1fr 1fr; }
    .invoice-sheet { padding: 18px 14px; }
    .balance-grid { grid-template-columns: 1fr; gap: 10px; }
    .ticket-update { grid-template-columns: 1fr; }
    .site-footer { margin-top: 48px; }
}