/* ===== ImmoPapaFils ===== */
:root {
    --ink: #1E2A38;
    --muted: #5B6675;
    --line: #DDE2E8;
    --accent: #3B5B7A;
    --accent-dark: #2A4560;
    --page: #F3F5F7;
}

html, body {
    font-family: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
}

body {
    background: var(--page);
    color: var(--ink);
}

.btn-primary {
    color: #fff;
    background-color: var(--accent);
    border-color: var(--accent);
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--accent-dark);
        border-color: var(--accent-dark);
    }

/* En-tête de page */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

    .page-head h1 {
        margin: 0;
        font-weight: 600;
        letter-spacing: -0.01em;
    }

    .page-head p {
        margin: .25rem 0 0;
        color: var(--muted);
    }

.page-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
}

/* Grilles de cartes */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.card-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}

/* Cartes */
.tile {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
}

a.tile:hover {
    border-color: var(--accent);
    color: var(--ink);
}

    a.tile:hover h2 {
        text-decoration: underline;
    }

a.tile:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.tile-head {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
}

.tile-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #E7DDCB;
    color: #6B5B4A;
}

.tile h2 {
    margin: 0 0 .15rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.tile p {
    margin: 0;
    font-size: .9rem;
    color: var(--muted);
}

.tile-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: .85rem;
    border-top: 1px solid #E6E9ED;
    font-size: .9rem;
    font-weight: 500;
}

.tile-more {
    display: flex;
    align-items: center;
    gap: .25rem;
    color: var(--accent);
}

/* Étiquettes de type */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 .65rem;
    border-radius: 13px;
    font-size: .8rem;
    font-weight: 500;
    background: #E3EAF2;
    color: #2A4560;
}

.chip-shop {
    background: #E2EEE7;
    color: #2F5A43;
}

.chip-muted {
    background: #E6E9ED;
    color: #4A5562;
}

/* Cartes de lots */
.unit-tile {
    gap: .5rem;
    padding: 1rem 1rem .5rem;
}

.unit-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

.unit-number {
    font-size: 1.4rem;
    font-weight: 600;
}

.unit-meta {
    display: flex;
    gap: .9rem;
    font-size: .9rem;
    color: var(--muted);
}

.unit-actions {
    display: flex;
    gap: .25rem;
    margin-top: .25rem;
    padding-top: .25rem;
    border-top: 1px solid #E6E9ED;
}

    .unit-actions a,
    .unit-actions button {
        display: inline-flex;
        align-items: center;
        height: 40px;
        padding: 0 .5rem;
        border: none;
        background: none;
        font: inherit;
        font-size: .9rem;
        font-weight: 500;
        color: var(--accent);
        text-decoration: none;
    }

    .unit-actions button {
        color: #A33A2E;
    }

.empty-state {
    padding: 2rem;
    border: 1px dashed #C4CCD6;
    border-radius: 10px;
    text-align: center;
    color: var(--muted);
}
/* ===== Vidéo en fond de page ===== */
.page-video {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -2;
}

.page-video-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(30, 42, 56, .72);
}

/* Uniquement sur une page qui contient la vidéo */
body:has(.page-video) {
    background: #1E2A38 url('/videos/hero.jpg') center / cover fixed;
}

    body:has(.page-video) .sidebar {
        background: rgba(20, 29, 40, .55);
        backdrop-filter: blur(6px);
    }

    body:has(.page-video) .top-row {
        background: transparent;
        border-bottom-color: rgba(255, 255, 255, .12);
    }

.page-head-light h1 {
    color: #fff;
}

.page-head-light p {
    color: #D3DCE6;
}

@media (prefers-reduced-motion: reduce) {
    .page-video {
        display: none;
    }
}
/* ===== Menu : compte ===== */
.nav-separator {
    height: 1px;
    margin: .75rem 1rem;
    background: rgba(255, 255, 255, .12);
}

.nav-button {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    color: inherit;
}

.nav-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Section Loyers */
.payments {
    border-top: 1px solid #e5e5e5;
    margin-top: 1rem;
    padding-top: 1rem;
}

.payments-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}

    .payments-head h3 {
        font-size: 1rem;
        margin: 0;
    }

.payment-form {
    background: #f6f6f4;
    border-radius: .5rem;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
}

.month-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.3fr 1fr;
    gap: .75rem;
    align-items: center;
    padding: .5rem 0;
    border-top: 1px solid #eee;
    font-size: .9rem;
}

    .month-row small {
        display: block;
        color: #6c757d;
    }

.month-head {
    border-top: none;
    font-size: .8rem;
    color: #6c757d;
    padding-bottom: 0;
}

.payment-line {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    font-size: .85rem;
    color: #6c757d;
    padding: 0 0 .5rem 1rem;
}

    .payment-line.rejected {
        color: #a32d2d;
    }

    .payment-line button, .link-button {
        background: none;
        border: 0;
        padding: 0;
        color: var(--bs-link-color);
        font-size: .85rem;
    }

        .payment-line button.danger {
            color: #a32d2d;
        }

.link-button {
    margin-top: .5rem;
}

.chip-danger {
    background: #fcebeb;
    color: #791f1f;
}

/* Paiements à valider */
.pending-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
}

    .pending-main small {
        display: block;
        color: #6c757d;
    }

.pending-meta {
    border-top: 1px solid #eee;
    margin-top: .75rem;
    padding-top: .5rem;
    font-size: .85rem;
    color: #6c757d;
}

.reject-box {
    margin-top: .75rem;
}
.payment-line .icon {
    width: 1rem;
    text-align: center;
}

.payment-line.validated {
    background: #eef4fb;
    color: #333;
    border-radius: .375rem;
    padding: .35rem .5rem .35rem 1rem;
    margin-bottom: .35rem;
}

    .payment-line.validated .icon {
        color: #3b6d11;
    }

.payment-line.pending .icon {
    color: #854f0b;
}
/* Suivi des loyers */
.month-picker {
    display: flex;
    align-items: center;
    gap: .75rem;
}

    .month-picker strong {
        min-width: 9rem;
        text-align: center;
    }

.follow-building {
    padding: 0;
    overflow: hidden;
}

.follow-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #f6f6f4;
}

    .follow-head h2 {
        font-size: 1.1rem;
        margin: 0;
    }

    .follow-head small {
        color: #6c757d;
    }

.follow-kpis {
    display: flex;
    gap: 1.5rem;
    font-size: .8rem;
    color: #6c757d;
}

    .follow-kpis strong {
        display: block;
        font-size: 1rem;
        color: #212529;
    }

.follow-row {
    display: grid;
    grid-template-columns: .7fr 1.6fr 1fr 1.2fr 1fr 1fr;
    gap: .75rem;
    align-items: center;
    padding: .6rem 1.25rem;
    border-top: 1px solid #eee;
    font-size: .9rem;
}

    .follow-row small {
        display: block;
        color: #6c757d;
    }

.follow-row-head {
    font-size: .8rem;
    color: #6c757d;
}

.follow-vacant {
    color: #6c757d;
}

.follow-kpis .text-paid {
    color: #3b6d11;
}

.follow-kpis .text-pending {
    color: #854f0b;
}

.text-late {
    color: #a32d2d !important;
}
.follow-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

    .follow-filters .form-select {
        width: auto;
        min-width: 14rem;
    }
/* ===== Onglets de région (page Immeubles) ===== */
.region-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .2);
}

.region-tab {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: .6rem .25rem;
    margin-bottom: -1px;
    border-bottom: 3px solid transparent;
    color: #C3CDD8;
    font-weight: 600;
    text-decoration: none;
}

    .region-tab:hover {
        color: #fff;
    }

    .region-tab:focus-visible {
        outline: 3px solid #E7DDCB;
        outline-offset: 2px;
        border-radius: 4px;
    }

    .region-tab.active {
        color: #fff;
        border-bottom-color: #E7DDCB;
    }

.region-count {
    min-width: 1.6rem;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: .8rem;
    text-align: center;
}

.region-tab.active .region-count {
    background: #E7DDCB;
    color: #1E2A38;
}

/* Badge de région sur la carte d'un immeuble */
.region-badge {
    display: inline-block;
    margin: .1rem 0 .35rem;
    padding: .15rem .5rem;
    border-radius: 4px;
    background: #E7DDCB;
    color: #4A3B22;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
/* ===== Locataires groupés par immeuble ===== */
.tenant-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .2);
}

    .tenant-toolbar .region-tabs {
        margin-bottom: 0;
        border-bottom: none;
    }

.tenant-search {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: min(340px, 100%);
    height: 44px;
    margin-bottom: .5rem;
    padding: 0 .9rem;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
}

    .tenant-search:focus-within {
        outline: 3px solid #E7DDCB;
    }

    .tenant-search input {
        flex: 1;
        min-width: 0;
        border: none;
        outline: none;
        background: transparent;
        font: inherit;
        color: var(--ink);
    }

.tg-section {
    margin-bottom: 1.25rem;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.tg-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.25rem;
    background: var(--page);
}

    .tg-head .tile-icon {
        width: 40px;
        height: 40px;
    }

    .tg-head h2 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .tg-head small {
        color: var(--muted);
    }

    .tg-head a {
        margin-left: auto;
        color: var(--accent);
        font-size: .9rem;
        font-weight: 500;
        text-decoration: none;
    }

.tg-row {
    display: grid;
    grid-template-columns: 110px 1.6fr 1.5fr 1fr 20px;
    gap: 1rem;
    align-items: center;
    padding: .75rem 1.25rem;
    border-top: 1px solid #E6E9ED;
    color: var(--ink);
    text-decoration: none;
}

    .tg-row:hover {
        background: #F7F9FB;
        color: var(--ink);
    }

    .tg-row:focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: -3px;
    }

    .tg-row small {
        display: block;
        color: var(--muted);
        font-size: .85rem;
    }

.tg-lot {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 .6rem;
    border-radius: 6px;
    background: #E3EAF2;
    color: #2A4560;
    font-weight: 600;
    font-size: .9rem;
}

.tg-person {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 600;
}

.tg-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #E7DDCB;
    color: #6B5B4A;
    font-size: .8rem;
    font-weight: 600;
}

.tg-amount {
    font-weight: 600;
}

.tg-none {
    padding: 1rem 1.25rem;
    border: 1px dashed rgba(255, 255, 255, .35);
    border-radius: 10px;
    color: #fff;
}

    .tg-none h2 {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 600;
    }

        .tg-none h2 small {
            margin-left: .5rem;
            color: #D3DCE6;
            font-weight: 400;
        }

.tg-none-list {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin-top: .75rem;
}

    .tg-none-list a {
        display: flex;
        align-items: center;
        gap: .6rem;
        color: #fff;
        text-decoration: none;
    }

        .tg-none-list a:hover {
            text-decoration: underline;
        }

/* Sur téléphone : lot, nom et flèche seulement */
@media (max-width: 768px) {
    .tg-row {
        grid-template-columns: 80px 1fr 20px;
    }

        .tg-row .tg-contact,
        .tg-row .tg-amount {
            display: none;
        }
}
/* ===== Détail d'un immeuble ===== */
.building-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
}

    .building-title .region-badge {
        margin: 0;
    }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem;
    margin-bottom: 1.25rem;
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

    .kpi span {
        font-size: .85rem;
        color: var(--muted);
    }

    .kpi strong {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--ink);
    }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.filter-btn {
    min-height: 40px;
    padding: 0 .9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: .9rem;
    font-weight: 500;
}

    .filter-btn:hover {
        border-color: var(--accent);
    }

    .filter-btn.active {
        background: var(--ink);
        border-color: var(--ink);
        color: #fff;
    }

.unit-occupant {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    background: var(--page);
    color: var(--ink);
    text-decoration: none;
}

    .unit-occupant:hover {
        background: #E9EDF2;
        color: var(--ink);
    }

    .unit-occupant:focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: 2px;
    }

.unit-occupant-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

    .unit-occupant-text strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .unit-occupant-text small {
        font-size: .8rem;
        color: var(--muted);
    }

.unit-free {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .6rem .75rem;
    border: 1px dashed #E3C890;
    border-radius: 8px;
    background: #FFFAF0;
}

    .unit-free a {
        color: var(--accent);
        font-size: .9rem;
        font-weight: 600;
        text-decoration: none;
    }

.badge-ok,
.badge-free {
    flex-shrink: 0;
    padding: .1rem .5rem;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-ok {
    background: #E2EEE7;
    color: #2F5A43;
}

.badge-free {
    background: #FBF0DC;
    color: #7A4E0B;
}
/* ===== Page de connexion ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    padding: 3rem 1.25rem;
    box-sizing: border-box;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
}

.login-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #E7DDCB;
    color: #6B5B4A;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.25rem;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    box-sizing: border-box;
}

    .login-card h1 {
        margin: 0;
        font-size: 1.75rem;
        font-weight: 600;
        color: var(--ink);
    }

.login-sub {
    margin: .35rem 0 1.5rem;
    color: var(--muted);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.1rem;
}

    .login-field label {
        font-size: .9rem;
        font-weight: 600;
        color: var(--ink);
    }

    .login-field .form-control {
        height: 48px;
    }

.login-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
}

    .login-label-row a {
        font-size: .875rem;
        color: var(--accent);
        text-decoration: none;
    }

        .login-label-row a:hover {
            text-decoration: underline;
        }

.login-remember {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 32px;
    margin-bottom: 1.25rem;
    color: var(--ink);
}

    .login-remember .form-check-input {
        width: 18px;
        height: 18px;
        margin: 0;
    }

.login-submit {
    width: 100%;
    height: 50px;
    font-size: 1.05rem;
    font-weight: 600;
}

.login-foot {
    margin: 0;
    font-size: .9rem;
    color: #D3DCE6;
}