/* =====================================================
   Locaux Dispo - Design System
   Charte Royal Kids Group
   ===================================================== */

:root {
    /* Couleurs principales */
    --rk-red: #E30613;
    --rk-red-dark: #B8050F;
    --rk-red-soft: #FDEDEE;

    /* Couleurs marques adaptées */
    --color-rk: #E30613;
    --color-uj: #F39C12;
    --color-pp: #8E44AD;

    /* Neutres */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-300: #D4D4D8;
    --gray-400: #A1A1AA;
    --gray-500: #71717A;
    --gray-600: #52525B;
    --gray-700: #3F3F46;
    --gray-800: #27272A;
    --gray-900: #18181B;

    /* États */
    --success: #7CB342;
    --success-light: #DCEDC8;
    --info: #2196F3;
    --warning: #FF9800;
    --danger: #E30613;

    /* Layout */
    --sidebar-width: 210px;
    --header-height: 80px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.08);

    /* Typographie */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* =====================================================
   Layout général
   ===================================================== */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 28px 32px;
    min-width: 0;
}

/* =====================================================
   Sidebar
   ===================================================== */

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px 28px;
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 100%;
    max-width: 150px;
    max-height: 56px;
    height: auto;
    display: block;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 4px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    position: relative;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.is-active {
    background: var(--rk-red-soft);
    color: var(--rk-red);
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon::before {
    content: '';
    width: 18px;
    height: 18px;
    background-color: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.nav-icon[data-icon="search"]::before  { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>"); }
.nav-icon[data-icon="list"]::before    { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round'><path d='M8 6h13'/><path d='M8 12h13'/><path d='M8 18h13'/><path d='M3 6h.01'/><path d='M3 12h.01'/><path d='M3 18h.01'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round'><path d='M8 6h13'/><path d='M8 12h13'/><path d='M8 18h13'/><path d='M3 6h.01'/><path d='M3 12h.01'/><path d='M3 18h.01'/></svg>"); }
.nav-icon[data-icon="inbox"]::before   { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linejoin='round'><path d='M3 10h6l1 2h4l1-2h6'/><path d='M3 10v8a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-8'/><path d='M3 10 6 4h12l3 6'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linejoin='round'><path d='M3 10h6l1 2h4l1-2h6'/><path d='M3 10v8a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-8'/><path d='M3 10 6 4h12l3 6'/></svg>"); }
.nav-icon[data-icon="plus"]::before    { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round'><rect x='3' y='7' width='14' height='12' rx='2'/><circle cx='19' cy='7' r='4' fill='currentColor'/><path stroke='%23fff' d='M17 7h4M19 5v4'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round'><rect x='3' y='7' width='14' height='12' rx='2'/><circle cx='19' cy='7' r='4' fill='currentColor'/><path stroke='%23fff' d='M17 7h4M19 5v4'/></svg>"); }
.nav-icon[data-icon="heart"]::before   { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linejoin='round'><path d='M12 21s-7-4.5-9.5-9.5C1 8 3.5 4 7.5 4c2 0 3.5 1 4.5 2.5C13 5 14.5 4 16.5 4c4 0 6.5 4 5 7.5C19 16.5 12 21 12 21Z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linejoin='round'><path d='M12 21s-7-4.5-9.5-9.5C1 8 3.5 4 7.5 4c2 0 3.5 1 4.5 2.5C13 5 14.5 4 16.5 4c4 0 6.5 4 5 7.5C19 16.5 12 21 12 21Z'/></svg>"); }
.nav-icon[data-icon="gear"]::before    { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/></svg>"); }
.nav-icon[data-icon="logout"]::before  { mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><path d='M16 17l5-5-5-5'/><path d='M21 12H9'/></svg>"); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><path d='M16 17l5-5-5-5'/><path d='M21 12H9'/></svg>"); }

.nav-label { flex: 1; }

.nav-badge {
    background: var(--rk-red);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--gray-200);
}

.nav-logout { color: var(--gray-500); }

/* Bouton notifications (sidebar) */
.push-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    margin-bottom: 4px;
}
.push-toggle.is-on { color: var(--rk-red); }
.push-toggle.is-on .fa-solid { color: var(--rk-red); }
.push-toggle:disabled { opacity: .55; cursor: default; }

/* =====================================================
   Header de page
   ===================================================== */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title-block { flex: 1; min-width: 200px; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--gray-900);
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 13px;
    margin: 0;
}

.tab-switch {
    display: inline-flex;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.tab-switch a {
    padding: 8px 18px;
    border-radius: 8px;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s, color .15s;
}

.tab-switch a.is-active {
    background: var(--rk-red);
    color: var(--white);
}

.tab-switch svg { width: 14px; height: 14px; }

/* =====================================================
   Boutons
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--rk-red);
    color: var(--white);
}
.btn-primary:hover { background: var(--rk-red-dark); }

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-50); }

/* Bouton de suppression : discret au repos, rouge plein au survol */
.btn-danger {
    background: var(--white);
    color: var(--rk-red);
    border: 1px solid var(--gray-200);
}
.btn-danger:hover { background: var(--rk-red); color: var(--white); border-color: var(--rk-red); }

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn svg { width: 16px; height: 16px; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

/* =====================================================
   Cards & blocs
   ===================================================== */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.card-pad { padding: 20px 22px; }

.card + .card { margin-top: 16px; }

/* =====================================================
   Filtres
   ===================================================== */

.filters {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 18px 22px;
    margin-bottom: 18px;
}

.filters-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 14px;
}

.filters-title::before {
    content: '';
    width: 16px; height: 16px;
    background: currentColor;
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M3 6h18M6 12h12M10 18h4'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='M3 6h18M6 12h12M10 18h4'/></svg>");
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1.4fr 1.6fr;
    gap: 18px 24px;
    align-items: end;
}

.filters-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 18px 24px;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 12px;
    color: var(--gray-700);
    font-weight: 500;
    display: inline-block;
    margin-bottom: 6px;
}

.input, .select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: 13px;
    color: var(--gray-900);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}

.input:focus, .select:focus {
    outline: none;
    border-color: var(--rk-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, .1);
}

.input-with-icon {
    position: relative;
}
.input-with-icon .input { padding-left: 36px; }
.input-with-icon::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    background: var(--gray-400);
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
}

.range-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.range-row .field-label { color: var(--gray-700); }
.range-row .range-value { font-weight: 600; color: var(--gray-900); }

.range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-pill);
    outline: none;
}
.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--rk-red);
    cursor: pointer;
}
.range::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--rk-red);
    cursor: pointer;
    border: none;
}

.range-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}

.surface-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}
.surface-range .sep { color: var(--gray-400); }

.filters-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

/* =====================================================
   Listing locaux (tableau)
   ===================================================== */

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.list-toolbar-actions { display: flex; gap: 8px; }

.list-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 4px;
}

.sort-control .sort-label {
    font-size: 12px;
    color: var(--gray-500);
    padding: 0 8px;
}

.sort-control .select {
    border: none;
    background: transparent;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--gray-700);
    cursor: pointer;
}

.locaux-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.locaux-table .thead {
    display: grid;
    grid-template-columns: 2.3fr 0.8fr 1.1fr 0.95fr 1fr 0.95fr 0.95fr 1.1fr 1.5fr;
    padding: 12px 16px;
    column-gap: 10px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.locaux-table .tr {
    display: grid;
    grid-template-columns: 2.3fr 0.8fr 1.1fr 0.95fr 1fr 0.95fr 0.95fr 1.1fr 1.5fr;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    align-items: start;
    column-gap: 10px;
    transition: background .12s;
}
.locaux-table .tr > div { padding-top: 2px; min-width: 0; }
.locaux-table .thead > div { min-width: 0; }
.locaux-table .tr .local-cell { padding-top: 0; }

.locaux-table .tr:last-child { border-bottom: none; }
.locaux-table .tr:hover { background: var(--gray-50); }

.local-cell {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}
.local-cell > div:last-child { min-width: 0; }

.local-thumb {
    width: 64px;
    height: 44px;
    border-radius: 6px;
    background: var(--gray-200) center/cover no-repeat;
    flex-shrink: 0;
}

.local-title {
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.local-loc {
    font-size: 12px;
    color: var(--gray-500);
    display: block;
}
.local-cell .zone-pill {
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-100);
    border-radius: 999px;
    padding: 1px 8px;
}

/* Loyer sur 2 lignes : montant gros/gras + type dessous */
.cell-loyer { line-height: 1.15; }
.loyer-amount {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
}
.loyer-type {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 1px;
}

.cell-with-icon {
    display: inline-flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 12px;
    color: var(--gray-700);
    line-height: 1.35;
}

.cell-with-icon svg, .cell-with-icon i {
    width: 14px;
    text-align: center;
    font-size: 11px;
    line-height: 1.35;
    color: var(--gray-400);
    margin-top: 1px;
    flex: none;
}

.col-disponibilite {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.tr .col-disponibilite {
    font-size: 12px;
    color: var(--gray-800);
    line-height: 1.35;
}
.col-disponibilite .dispo-label { font-weight: 600; }

.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin: 0;
    flex: none;
    vertical-align: middle;
}
.col-disponibilite .status-dot { margin-top: 4px; }
.status-dot.dot-success { background: var(--success); }
.status-dot.dot-warning { background: var(--warning); }
.status-dot.dot-muted { background: var(--gray-300); }

.brand-badges {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
}
.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 5px;
    color: var(--white);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}
.brand-rk { background: var(--color-rk); }
.brand-uj { background: var(--color-uj); }
.brand-pp { background: var(--color-pp); }

.added-meta {
    font-size: 11px;
    color: var(--gray-500);
    line-height: 1.4;
}
.added-meta b { color: var(--gray-800); font-weight: 600; }

.contact-meta {
    font-size: 11px;
    line-height: 1.3;
    min-width: 0;
}
.contact-meta .contact-name { font-weight: 600; color: var(--gray-900); font-size: 12px; }
.contact-meta .contact-agency { color: var(--gray-500); }

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    color: var(--white);
}
.btn-action-call { background: var(--success); }
.btn-action-mail { background: var(--gray-300); color: var(--gray-700); }

.btn-action svg { width: 10px; height: 10px; }

.row-icons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

/* Cellule CONTACT de la liste : nom au-dessus, boutons en dessous, coeur en haut à droite */
.cell-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.cell-contact-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}
.cell-contact .contact-meta { flex: 1 1 auto; min-width: 0; }
.cell-contact .action-buttons { flex-direction: row; flex-wrap: wrap; gap: 4px; }
.cell-contact .row-icons { flex: none; margin-left: 0; }
.icon-action i { font-size: 15px; }

.icon-action {
    width: 22px; height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    cursor: pointer;
    transition: color .15s;
    background: transparent;
    border: none;
}
.icon-action:hover { color: var(--gray-700); }
.icon-action.is-active { color: var(--rk-red); }
.icon-action.flag-green { color: var(--success); }

.icon-action svg { width: 18px; height: 18px; }

/* =====================================================
   Pagination
   ===================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 18px;
    padding: 12px;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.page-link {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 13px;
    padding: 0 8px;
}
.page-link:hover { background: var(--gray-100); }
.page-link.is-current {
    background: var(--rk-red);
    color: var(--white);
}

/* =====================================================
   Map
   ===================================================== */

.map-container {
    height: 600px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--white);
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.leaflet-popup-content-wrapper { border-radius: 12px; padding: 0; }
.leaflet-popup-content { margin: 0; width: 320px !important; }
/* Avec isolation:isolate sur le conteneur, ces z-index restent piégés dans
   le conteneur carte ; on les garde modestes par cohérence. */
.fiche-map .leaflet-container,
.map-container .leaflet-container { z-index: 0; }
/* Leaflet force la couleur des liens dans ses popups : on rétablit le blanc du bouton */
.leaflet-popup-content a.btn-primary,
.leaflet-popup-content a.btn-primary:hover { color: #fff; }

.popup-card { padding: 12px; display: flex; gap: 10px; }
.popup-thumb {
    width: 90px; height: 70px;
    border-radius: 8px;
    background: var(--gray-200) center/cover no-repeat;
    flex-shrink: 0;
}
.popup-body { flex: 1; min-width: 0; }
.popup-title {
    font-weight: 700;
    margin: 0 0 2px;
    font-size: 13px;
    color: var(--gray-900);
}
.popup-loc { font-size: 11px; color: var(--gray-600); margin-bottom: 6px; }
.popup-meta { font-size: 11px; color: var(--gray-700); display: flex; flex-direction: column; gap: 2px; }
.popup-actions {
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--gray-50);
}
.popup-price {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 13px;
}

/* Marker numéroté custom Leaflet */
.cluster-marker {
    background: var(--rk-red);
    color: var(--white);
    border-radius: 50% 50% 50% 0;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.cluster-marker span { transform: rotate(45deg); font-size: 12px; }

/* =====================================================
   Fiche local (détail)
   ===================================================== */

.fiche-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.fiche-hero {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.fiche-photo {
    position: relative;
    height: 320px;
    background: var(--gray-300) center/cover no-repeat;
}

.fiche-photo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: var(--gray-800);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 2;
    transition: background .15s;
}
.fiche-photo-nav:hover { background: #fff; }
.fiche-photo-nav.prev { left: 12px; }
.fiche-photo-nav.next { right: 12px; }
.fiche-photo-nav i { font-size: 14px; }

.fiche-photo.is-zoomable { cursor: zoom-in; }

/* Lightbox plein écran */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.lightbox-close {
    position: absolute;
    top: 18px; right: 22px;
    width: 44px; height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }
.lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 14px;
    border-radius: 20px;
}
@media (max-width: 860px) {
    .lightbox-nav { width: 40px; height: 40px; }
    .lightbox-nav.prev { left: 8px; }
    .lightbox-nav.next { right: 8px; }
}

.fiche-photo-badges {
    position: absolute;
    bottom: 12px; left: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.erp-badge {
    background: var(--white);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-800);
}

.fiche-photo-count {
    position: absolute;
    bottom: 12px; right: 12px;
    background: var(--rk-red);
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fiche-fav {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    background: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    border: none;
    color: var(--gray-400);
}
.fiche-fav.is-active { color: var(--rk-red); }
.fiche-fav svg { width: 18px; height: 18px; }

.fiche-photo-added {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.fiche-content {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.fiche-title-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.fiche-title { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.fiche-loc {
    color: var(--gray-600);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fiche-loc-region {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.fiche-surface-block {
    text-align: right;
}
.fiche-surface { font-size: 18px; font-weight: 700; }
.fiche-prix {
    background: var(--success);
    color: var(--white);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    margin-top: 6px;
    display: inline-block;
    font-size: 13px;
}
.fiche-prix-sec {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.fiche-section {
    border-top: 1px solid var(--gray-200);
    padding-top: 14px;
}

.fiche-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--rk-red);
    text-transform: none;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.fiche-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.fiche-row { font-size: 13px; margin: 5px 0; color: var(--gray-700); }
.fiche-row b { color: var(--gray-900); font-weight: 600; }

.surf-line {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.surf-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--gray-700);
}
.surf-pill::before {
    content: '';
    width: 8px; height: 8px;
    background: var(--rk-red);
    border-radius: 1px;
}
.surf-pill.r1::before { background: #F39C12; }
.surf-pill.mez::before { background: var(--color-pp); }
.surf-pill.ss::before { background: var(--gray-500); }

.fiche-map {
    grid-column: 2;
    grid-row: 2 / span 3;
    height: 280px;
    border-radius: var(--radius-md);
    background: var(--gray-200);
    overflow: hidden;
    /* Confine les z-index internes de Leaflet (panes/contrôles montent jusqu'à
       ~700-1000) pour qu'ils ne passent jamais au-dessus de la topbar/sidebar. */
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.fiche-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200);
}

.fiche-side .card { padding: 16px 18px; }
.fiche-side .card + .card { margin-top: 14px; }

.side-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--rk-red);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.side-title::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

.contact-line { font-size: 13px; margin: 4px 0; color: var(--gray-800); }
.contact-line b { font-weight: 600; }

.btn-contact-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    background: var(--success);
    color: var(--white);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-decoration: none;
    box-sizing: border-box;
}

.comment-item {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--success);
    font-size: 12px;
    margin: 4px 0;
}

.empty-block { color: var(--gray-400); font-size: 12px; font-style: italic; }

/* --- Commentaires & visites enrichis (fiche) --- */
.comment-full {
    display: block;
    align-items: stretch;
    color: var(--gray-700);
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0;
}
.comment-head { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.comment-head b { color: var(--gray-800); }
.comment-head .comment-del {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--gray-300);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 5px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.comment-head .comment-del:hover { color: #e74c3c; background: #fdecea; }
.comment-body { font-size: 13px; color: var(--gray-800); line-height: 1.45; white-space: pre-wrap; }

.visite-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0;
}
.visite-head { font-size: 13px; color: var(--gray-800); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.visite-statut {
    font-size: 11px; font-weight: 600; color: var(--gray-500);
    background: #fff; border: 1px solid var(--gray-200);
    border-radius: 20px; padding: 1px 8px;
}
.visite-meta { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.visite-notes { font-size: 12px; color: var(--gray-700); margin-top: 4px; line-height: 1.4; white-space: pre-wrap; }

.inline-add { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.inline-add textarea.input { resize: vertical; }
.inline-add .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-add .field-label { font-size: 12px; }
@media (max-width: 480px) {
    .inline-add .form-row { grid-template-columns: 1fr; }
}

.side-help {
    font-size: 11px;
    color: var(--gray-500);
    line-height: 1.5;
    font-style: italic;
    margin-top: 8px;
}
.side-help a { color: var(--rk-red); text-decoration: underline; }

/* =====================================================
   Formulaire Ajouter / Modifier
   ===================================================== */

.form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 22px 24px;
}

.form-col h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 18px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}

.form-col h3:first-child { margin-top: 0; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.detected-field .input,
.detected-field .select {
    color: var(--success);
    border-color: var(--success-light);
    background: #F8FBF3;
}

.form-actions {
    grid-column: 1 / -1;
    border-top: 1px solid var(--gray-200);
    padding-top: 16px;
    text-align: center;
}

.btn-detected {
    background: var(--success);
    color: var(--white);
}

.surface-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 8px;
    align-items: center;
    background: var(--gray-50);
    padding: 8px 10px;
    border-radius: var(--radius-md);
}
.surface-grid label {
    font-size: 11px;
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.surface-grid input {
    padding: 4px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
    width: 100%;
}

.add-surface-btn {
    grid-column: 1 / -1;
    background: var(--rk-red);
    color: var(--white);
    border: none;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
    margin-top: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-self: start;
}

.map-edit {
    height: 260px;
    border-radius: var(--radius-md);
    background: var(--gray-200);
    margin-bottom: 14px;
    overflow: hidden;
}

.gallery {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.gallery-item {
    width: 64px; height: 64px;
    border-radius: 6px;
    background: var(--gray-200) center/cover no-repeat;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    position: relative;
}
.gallery-add {
    background: var(--rk-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    border: none;
}
.gallery-add svg { width: 24px; height: 24px; }

.docs-list { margin-bottom: 10px; }
.docs-add {
    display: inline-flex;
    background: var(--rk-red);
    color: var(--white);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    gap: 4px;
    align-items: center;
}

.muti-add {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.muti-add .btn {
    flex: 1;
}

/* Brand multiselect chips */
.brand-multiselect {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 6px 10px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    min-height: 36px;
}
.brand-multiselect .brand-badge { width: 24px; height: 24px; font-size: 10px; }

/* =====================================================
   Propositions (inbox)
   ===================================================== */

.proposition-table {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.prop-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 2fr auto auto;
    gap: 12px;
    padding: 12px 18px;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}
.prop-row:last-child { border: none; }
.prop-row .prop-subject {
    color: var(--gray-900);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prop-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-600);
    font-size: 12px;
}
.prop-attachment svg { width: 12px; height: 12px; }

.btn-add-base {
    background: var(--success);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-trash {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
}
.btn-trash:hover { color: var(--danger); }

.preview-pane {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-top: 18px;
    overflow: hidden;
}

.preview-header {
    background: var(--rk-red);
    color: var(--white);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.preview-meta { font-size: 11px; line-height: 1.6; }
.preview-meta b { font-weight: 600; }
.preview-attachments { font-size: 11px; text-align: right; }
.preview-attachments a { color: var(--white); text-decoration: underline; }
.preview-body {
    padding: 16px 22px;
    font-size: 12px;
    color: var(--gray-700);
    line-height: 1.7;
    white-space: pre-line;
    max-height: 380px;
    overflow-y: auto;
}
.preview-foot {
    padding: 12px 18px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* =====================================================
   Empty states
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

/* =====================================================
   Time tabs (Derniers ajouts)
   ===================================================== */

.time-tabs {
    display: inline-flex;
    gap: 4px;
    background: var(--white);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}
.time-tab {
    padding: 8px 18px;
    border-radius: 8px;
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.time-tab.is-active {
    background: var(--rk-red);
    color: var(--white);
}
.time-tab svg { width: 14px; height: 14px; }

/* =====================================================
   Selections (Ma sélection)
   ===================================================== */

.selection-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 16px;
    border-top: 1px solid var(--gray-100);
}

.saved-lists {
    margin-top: 18px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.saved-lists-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--gray-800);
}

.saved-lists-header svg { width: 16px; height: 16px; }

.saved-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1fr 2fr auto;
    gap: 14px;
    padding: 12px 22px;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}
.saved-row:last-child { border: none; }
.saved-row .row-name {
    color: var(--gray-900);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.saved-row .row-actions {
    display: flex;
    gap: 6px;
}
.saved-row .row-actions .btn { padding: 5px 10px; font-size: 11px; }

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 1280px) {
    /* On masque DISPONIBILITÉ : il reste 8 colonnes visibles
       (LOCAL, SURFACE, LOCALISATION, LOYER, ADAPTÉ, AJOUTÉ, COMMENTAIRE, CONTACT). */
    .locaux-table .thead, .locaux-table .tr {
        grid-template-columns: 2.3fr 0.8fr 1.1fr 0.95fr 0.95fr 0.95fr 1.1fr 1.6fr;
    }
    .col-disponibilite { display: none; }
}

/* ============================================
   RESPONSIVE — tablette & mobile
   ============================================ */

/* Topbar mobile + overlay (cachés par défaut sur desktop) */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

/* Tablette : 2 colonnes */
@media (max-width: 1100px) {
    .add-grid { grid-template-columns: 1fr 1fr; }
    .add-col:nth-child(3) { grid-column: 1 / -1; }
    .add-col:nth-child(3) .map-edit { max-width: 420px; }
}

@media (max-width: 980px) {
    .filters-grid { grid-template-columns: 1fr 1fr; }
    .fiche-layout { grid-template-columns: 1fr; }
    .fiche-content { grid-template-columns: 1fr; }
    .fiche-map { grid-column: 1; grid-row: auto; }
    .form-layout { grid-template-columns: 1fr; }
    .public-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* Mobile : sidebar en drawer + topbar */
@media (max-width: 860px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 14px;
        background: #fff;
        padding: 10px 16px;
        border-bottom: 1px solid var(--gray-100);
        position: sticky;
        top: 0;
        z-index: 200;
    }
    .mobile-logo img { height: 34px; width: auto; display: block; }
    .mobile-burger {
        background: none; border: none; cursor: pointer;
        width: 40px; height: 40px; display: flex; flex-direction: column;
        justify-content: center; gap: 5px; padding: 8px;
    }
    .mobile-burger span {
        display: block; height: 2px; background: var(--gray-800); border-radius: 2px;
        transition: 0.2s;
    }

    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 250;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }
    .sidebar-overlay.is-visible { opacity: 1; pointer-events: auto; }

    .main-content { margin-left: 0; padding: 16px; }

    /* Formulaires en 1 colonne */
    .add-grid { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
    .add-col:nth-child(3) { grid-column: 1; }
    .add-col:nth-child(3) .map-edit { max-width: none; }
    .form-row { grid-template-columns: 1fr; }
    .filters-grid, .filters-grid-2 { grid-template-columns: 1fr; }
    .surfaces-block { grid-template-columns: 1fr; }

    /* En-têtes de page empilés */
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header .tab-switch, .page-header .btn { width: 100%; justify-content: center; }

    /* Tableaux : on masque l'en-tête et on passe en cartes */
    .locaux-table .thead { display: none; }
    .locaux-table .tr {
        display: block;
        position: relative;
        padding: 14px;
        border: 1px solid var(--gray-100);
        border-radius: 12px;
        margin-bottom: 12px;
    }
    .locaux-table .tr > div { display: block; padding: 3px 0; }
    .local-cell { margin-bottom: 8px; }
    .col-disponibilite, .added-meta, .contact-meta { font-size: 12px; }
    .action-buttons { margin-top: 8px; display: flex; gap: 8px; }
    .action-buttons .btn-action { flex: 1; justify-content: center; }
    /* La case favori repasse en haut à droite de la carte */
    .locaux-table .tr .cell-contact .cell-contact-top { justify-content: space-between; }
    /* Commentaire : pleine largeur lisible */
    .locaux-table .tr .cell-comment { white-space: normal; }

    /* Listes sauvegardées + lignes archivées : empilées */
    .saved-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 14px 16px;
    }
    .saved-row .row-actions { flex-wrap: wrap; }

    /* Fiche local : contenu 1 colonne + anti-débordement */
    .fiche-layout, .fiche-main, .fiche-side { min-width: 0; }
    .fiche-hero { min-width: 0; }
    .fiche-content { grid-template-columns: 1fr; padding: 16px; min-width: 0; }
    .fiche-content > * { min-width: 0; }
    /* Titre + surface : on empile au lieu de space-between serré */
    .fiche-title-row { flex-direction: column; gap: 12px; }
    .fiche-surface-block { text-align: left; }
    .fiche-title { font-size: 18px; }
    /* Carte : pleine largeur, hauteur raisonnable */
    .fiche-map { grid-column: 1 !important; grid-row: auto !important; height: 220px; width: 100%; }
    /* Boutons d'action : empilés pleine largeur (sinon ils étirent la grille) */
    .fiche-actions { flex-direction: column; align-items: stretch; }
    .fiche-actions .btn { width: 100%; justify-content: center; }
    /* Photo hero un peu moins haute sur mobile */
    .fiche-photo { height: 220px; }

    /* Toolbar liste empilée */
    .list-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .list-toolbar-actions { flex-direction: column; gap: 8px; width: 100%; }
    .list-toolbar .btn { width: 100%; justify-content: center; }

    /* Carte plein écran adaptée + popup qui ne déborde pas */
    .map-container { height: 460px; }
    .leaflet-popup-content { width: auto !important; max-width: 78vw; }
    .tab-switch { width: 100%; }
    .tab-switch a { flex: 1; justify-content: center; }

    /* Propositions : en colonnes simplifiées */
    .prop-row { grid-template-columns: 1fr; gap: 4px; }
    .prop-row-head { display: none; }

    /* Pagination compacte */
    .pagination { flex-wrap: wrap; }

    /* PDF / public : 1 colonne déjà géré */
    .public-grid { grid-template-columns: 1fr; }
    .public-header { flex-direction: row; }

    /* Modale plein écran */
    .modal-content { max-width: 100%; }

    /* Login */
    .login-card { padding: 28px 22px; }
}

/* Petit mobile */
@media (max-width: 480px) {
    .main-content { padding: 12px; }
    .page-title { font-size: 20px; }
    .add-grid { padding: 14px; }
    .cv-buttons { flex-direction: column; }
}

/* ============================================
   ENSEIGNES (filtres + paramètres)
   ============================================ */
.enseignes-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.enseigne-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    background: #fff;
    transition: background 0.15s;
}
.enseigne-chip:hover { background: var(--gray-50); }
.enseigne-chip input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}
.enseigne-chip .chip-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}
.enseigne-chip:has(input:checked) {
    background: var(--gray-50);
    box-shadow: inset 0 0 0 1px currentColor;
}

/* Liste enseignes dans paramètres */
.enseignes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.enseigne-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
}
.enseigne-info { flex: 1; }
.enseigne-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.enseigne-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--gray-500);
}
.enseigne-meta code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
    color: var(--gray-700);
}
.enseigne-color {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, monospace;
}
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}
.enseigne-actions {
    display: flex;
    gap: 6px;
}
.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* ============================================
   MODALE (utilisée pour enseignes dans paramètres)
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--gray-900);
}
.modal-body {
    padding: 22px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}
.btn-ghost {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 16px;
}
.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* ============================================
   Font Awesome - tailles + alignement
   ============================================ */
.btn .fa-solid, .btn .fa-regular {
    font-size: 13px;
}
.btn-lg .fa-solid, .btn-lg .fa-regular {
    font-size: 15px;
}
.nav-item .fa-solid, .nav-item .fa-regular {
    font-size: 14px;
    width: 18px;
    text-align: center;
}
.cell-with-icon .fa-solid, .cell-with-icon .fa-regular {
    color: var(--gray-500);
}
.icon-action .fa-solid.fa-heart {
    color: var(--rk-red);
}
.icon-action .fa-regular.fa-heart {
    color: var(--gray-400);
}
.icon-action:hover .fa-regular.fa-heart { color: var(--rk-red); }
.fa-spin {
    animation: fa-spin 1s linear infinite;
}
@keyframes fa-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pagination cliquable */
.pagination .page-link {
    cursor: pointer;
}
.pagination .page-link:not(.is-current):hover {
    background: var(--gray-100);
}

/* ============================================
   UPLOADS (galerie photos + documents)
   ============================================ */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    background: var(--gray-200) center/cover no-repeat;
    overflow: hidden;
}
.gallery-cover-badge {
    position: absolute;
    top: 6px; left: 6px;
    background: var(--rk-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    z-index: 2;
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.15s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--gray-800);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.gallery-btn:hover { background: #fff; }
.gallery-btn-del:hover { background: var(--danger); color: #fff; }
.gallery-add {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rk-red);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    transition: background 0.15s;
}
.gallery-add:hover { background: var(--rk-red-dark, #b8050f); }
.gallery-add.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
.gallery-add.is-loading::after {
    content: '';
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fa-spin 0.7s linear infinite;
    position: absolute;
}

.docs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: 10px;
    font-size: 13px;
    transition: all 0.15s;
}
.doc-item:hover { border-color: var(--gray-300); box-shadow: 0 1px 4px rgba(0,0,0,0.04); }

/* Icône colorée selon le type de fichier */
.doc-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 14px;
}
.doc-icon.is-pdf { background: #fdecea; color: #c62828; }
.doc-icon.is-img { background: #e3f2fd; color: #1565c0; }
.doc-icon.is-doc { background: #e8f5e9; color: #2e7d32; }
.doc-icon.is-xls { background: #e8f5e9; color: #2e7d32; }

.doc-meta { flex: 1; min-width: 0; }
.doc-item a {
    display: block;
    color: var(--gray-900);
    text-decoration: none;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.doc-item a:hover { color: var(--rk-red); }
.doc-size {
    color: var(--gray-400);
    font-size: 11px;
    display: block;
    margin-top: 2px;
}
.doc-empty {
    color: var(--gray-400);
    background: var(--gray-50);
    border-style: dashed;
    justify-content: center;
    text-align: center;
}
.doc-empty .doc-icon { background: transparent; }

.doc-del {
    background: none;
    border: none;
    color: var(--gray-300);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s;
}
.doc-del:hover { color: var(--danger); background: var(--gray-100); }
.docs-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rk-red);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.docs-add:hover { background: var(--rk-red-dark, #b8050f); }
.docs-add.is-loading { opacity: 0.6; pointer-events: none; }

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 16px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    color: var(--gray-400);
    text-align: center;
}
.upload-placeholder p { margin: 0; font-size: 13px; }

/* Bannière succès création */
.alert-success-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    margin-bottom: 18px;
    color: #2e7d32;
    font-size: 14px;
}
.alert-success-banner > div { flex: 1; }
.alert-success-banner .fa-solid.fa-check {
    font-size: 18px;
    color: #43a047;
}

.alert-error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fdecea;
    border: 1px solid #f5c6c2;
    border-radius: 10px;
    margin-bottom: 18px;
    color: #c0392b;
    font-size: 14px;
}
.alert-error-banner > div { flex: 1; }
.alert-error-banner .fa-solid { font-size: 18px; color: #e74c3c; }

/* ============================================
   LOGIN
   ============================================ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f6f8 0%, #e9ecf1 100%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo img {
    max-width: 150px;
    height: auto;
}
.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 4px;
    text-align: center;
}
.login-sub {
    color: var(--gray-500);
    font-size: 13px;
    text-align: center;
    margin: 0 0 24px;
}
.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #b71c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
}
.login-demo {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-100);
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.7;
}
.login-demo code {
    background: var(--gray-100);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
}

/* ============================================
   PAGE PUBLIQUE (sélection partagée)
   ============================================ */
.public-body { background: #f5f6f8; margin: 0; }
.public-shell { max-width: 1100px; margin: 0 auto; padding: 0 20px 40px; }
.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}
.public-logo { max-width: 140px; height: auto; }
.public-title-block { margin: 10px 0 24px; }
.public-title-block h1 { font-size: 26px; color: var(--gray-900); margin: 0 0 4px; }
.public-title-block p { color: var(--gray-500); font-size: 14px; margin: 0; }
.public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.public-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: transform 0.15s, box-shadow 0.15s;
}
.public-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.public-card-photo {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--gray-200) center/cover no-repeat;
}
.public-no-photo {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 28px;
}
.public-card-badges {
    position: absolute;
    bottom: 10px; left: 10px;
    display: flex;
    gap: 4px;
}
.public-card-body { padding: 16px 18px; }
.public-card-body h3 { margin: 0 0 8px; font-size: 16px; color: var(--gray-900); }
.public-card-loc { font-size: 13px; color: var(--gray-500); margin-bottom: 10px; }
.public-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 10px;
}
.public-card-price {
    background: #7CB342;
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}
.public-card-contact {
    font-size: 12px;
    color: var(--gray-500);
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}
.public-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
}
.public-empty h1 { color: var(--gray-700); margin: 16px 0 8px; }
.public-footer {
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    padding: 30px 0 0;
}

/* Feedback like */
.fav-pulse { animation: favPulse 0.3s ease; }
@keyframes favPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
/* Battement de coeur (ajout à la sélection depuis la fiche) */
.heart-beat { animation: heartBeat 0.7s ease; }
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.45); }
    45% { transform: scale(0.92); }
    65% { transform: scale(1.28); }
    100% { transform: scale(1); }
}
.icon-action.is-active i { color: var(--rk-red); }

/* Avertissement doublon */
.dup-warning {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    grid-column: 1 / -1;
}
.dup-warning-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f57f17;
    margin-bottom: 10px;
    font-size: 14px;
}
.dup-list { display: flex; flex-direction: column; gap: 6px; }
.dup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-800);
    font-size: 13px;
}
.dup-item:hover { border-color: #ffb300; }
.dup-item-title { font-weight: 600; flex: 1; }
.dup-item-loc { color: var(--gray-500); }
.dup-item-score {
    background: #ffe082;
    color: #f57f17;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

/* Propositions - statuts */
.prop-row-head {
    background: var(--gray-50);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: .4px;
}
.prop-done { opacity: 0.7; }
.prop-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.prop-badge-done { background: #e8f5e9; color: #2e7d32; }
.prop-badge-pending { background: #fff3e0; color: #ef6c00; }

/* ============================================
   PAGE AJOUTER UN LOCAL (refonte design)
   ============================================ */
.add-form { width: 100%; }
.add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.add-col { min-width: 0; }
.section-sep {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 22px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.add-col:first-child .section-sep:first-of-type { margin-top: 22px; }

/* Multiselect dropdown (Adapté) */
.ms-dropdown { position: relative; }
.ms-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    min-height: 44px;
    font-size: 14px;
}
.ms-toggle:hover { border-color: var(--gray-300); }
.ms-selected { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ms-placeholder { color: var(--gray-400); }
.ms-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px;
    z-index: 50;
    display: none;
}
.ms-dropdown.open .ms-menu { display: block; }
.ms-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.ms-option:hover { background: var(--gray-50); }
.ms-option input { width: 16px; height: 16px; cursor: pointer; }

/* Surfaces */
.surfaces-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.surf-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700);
}
.surf-check input[type="checkbox"] { width: 15px; height: 15px; flex-shrink: 0; }
.surf-check span { flex-shrink: 0; min-width: 62px; }
.surf-input {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
}
.surf-input:disabled { background: var(--gray-50); color: var(--gray-300); }

/* Input avec suffixe (€ HT/AN, etc.) */
.input-suffix {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}
.input-suffix .input {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}
.input-suffix .input:focus { outline: none; box-shadow: none; }
.input-suffix:focus-within { border-color: var(--rk-red); }
.suffix-label {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 12px;
    white-space: nowrap;
    border-left: 1px solid var(--gray-200);
}
.suffix-select {
    border: none;
    border-left: 1px solid var(--gray-200);
    background: var(--gray-50);
    padding: 0 8px;
    font-size: 12px;
    color: var(--gray-600);
    cursor: pointer;
}

/* Galerie - tuiles "Ajouter un média" */
.media-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    border: none;
    background: var(--rk-red);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}
.media-add i { font-size: 18px; }
.media-add:hover { background: var(--rk-red-dark, #b8050f); }
.media-add.is-loading { opacity: 0.6; pointer-events: none; }
.media-add-disabled { background: #f7b6bb; cursor: default; }
.media-add-disabled:hover { background: #f7b6bb; }

/* Boutons document */
.btn-doc-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rk-red);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}
.btn-doc-add:hover { background: var(--rk-red-dark, #b8050f); }
.btn-doc-add.is-disabled,
.btn-doc-add[disabled] {
    background: #f7b6bb;
    cursor: default;
    opacity: 0.85;
}
.btn-doc-add.is-disabled:hover { background: #f7b6bb; }

/* Boutons commentaire / visite */
.cv-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.btn-cv {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--rk-red);
    color: #fff;
    border: none;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.btn-cv:hover { background: var(--rk-red-dark, #b8050f); }

/* Bloc commentaires/visites dans le formulaire */
.cv-block {
    background: var(--gray-50, #fafafa);
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    padding: 14px;
}
.cv-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.cv-label i { color: var(--rk-red); }

/* Submit centré */
.add-submit {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.alert-info-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; background: #e8f5e9; border: 1px solid #a5d6a7;
    border-radius: 10px; margin-bottom: 18px; color: #2e7d32; font-size: 14px;
}
.detected-legend { color: #2e7d32; font-weight: 700; }
.detected-field .input,
.detected-field .select,
.detected-field .ms-toggle,
.detected-field .input-suffix { border-color: #66bb6a; background: #f1f8f2; }
.detected-field .field-label { color: #2e7d32; }

/* ============================================
   CHAMP "PAS SÛR" (orange)
   ============================================ */
.unsure-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    padding: 2px 6px;
    border-radius: 999px;
    transition: all 0.15s;
}
.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.field-label-row .field-label { margin-bottom: 0; }
.unsure-toggle:hover { color: #f57c00; background: #fff4e5; }
.unsure-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
    pointer-events: none;
    margin: 0;
}
.unsure-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: transparent;
}
.unsure-toggle.is-on { color: #ef6c00; background: #fff4e5; }
.unsure-toggle.is-on .unsure-dot { background: #ef6c00; border-color: #ef6c00; }

.field-unsure .input,
.field-unsure .select,
.field-unsure textarea.input {
    border-color: #ff9800 !important;
    background: #fff3e0 !important;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.18);
}
.field-unsure .field-label { color: #ef6c00; font-weight: 700; }

/* ============================================
   AUTOCOMPLÉTION ADRESSE
   ============================================ */
.addr-autocomplete { position: relative; }
.addr-suggest {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 60;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}
.addr-suggest.open { display: block; }
.addr-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-50);
}
.addr-item:last-child { border-bottom: none; }
.addr-item:hover { background: var(--gray-50); }
.addr-label { font-size: 13px; color: var(--gray-800); }
.addr-meta { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

.radius-hint {
    color: var(--primary, #e1001a);
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   COLONNE COMMENTAIRE + ZONE PILL
   ============================================ */
.cell-comment {
    font-size: 12px;
    color: var(--gray-700);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 100%;
}
.cell-comment-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}
.cell-comment i { color: #ef6c00; margin-right: 4px; }

.comment-edit-btn {
    flex: none;
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    padding: 3px;
    border-radius: 6px;
    line-height: 1;
    transition: all .12s;
}
.comment-edit-btn:hover { color: var(--rk-red); background: var(--gray-100); }

/* Mini-popup d'édition de commentaire (liste) */
.comment-pop-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 400;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.comment-pop {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.comment-pop h4 { margin: 0 0 12px; font-size: 15px; color: var(--gray-900); }
.comment-pop textarea {
    width: 100%; min-height: 110px; resize: vertical;
    padding: 10px 12px; border: 1px solid var(--gray-200);
    border-radius: 10px; font: inherit; font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}
.comment-pop textarea:focus {
    outline: none;
    border-color: var(--rk-red);
    box-shadow: 0 0 0 3px rgba(225, 0, 26, 0.15);
}
.comment-pop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.zone-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: #eef2f7;
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}

/* ============================================
   BOUTONS CONTACTER / COURRIEL GRISÉS
   ============================================ */
.btn-action.is-disabled {
    background: #f5f5f5 !important;
    color: #aaa !important;
    border-color: #e0e0e0 !important;
    cursor: not-allowed !important;
    pointer-events: auto;
    opacity: 0.7;
}
.btn-action.is-disabled:hover { background: #f5f5f5 !important; }
.btn-action.is-disabled i { color: #aaa !important; }

/* ============================================
   PLUS DE FILTRES (collapsible)
   ============================================ */
#btn-more-filters.is-active {
    background: var(--rk-red-soft, #fce8ea);
    color: var(--rk-red, #E30613);
    border-color: var(--rk-red, #E30613);
}
.more-filters {
    padding-top: 8px;
    border-top: 1px dashed var(--gray-200);
    margin-top: 16px;
}
.field-help { color: var(--gray-400); font-size: 11px; margin-top: 4px; display: block; }

/* Rayon : slider */
.radius-row { display: flex; align-items: center; gap: 14px; }
.radius-row input[type="range"] {
    flex: 1;
    accent-color: var(--rk-red, #E30613);
    height: 6px;
}
.radius-value {
    min-width: 70px;
    text-align: right;
    font-weight: 700;
    color: var(--rk-red, #E30613);
    font-size: 13px;
}

/* Radio pills (Photos: Tous / Avec / Sans) */
.radio-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.radio-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--gray-200);
    background: #fff;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.radio-pill input { display: none; }
.radio-pill:hover { border-color: var(--gray-400); }
.radio-pill.is-active {
    background: var(--rk-red-soft, #fce8ea);
    border-color: var(--rk-red, #E30613);
    color: var(--rk-red, #E30613);
    font-weight: 600;
}

/* Note interne (commentaire admin) sur la fiche */
.fiche-admin-comment {
    margin: 14px 0;
    padding: 12px 14px;
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 8px;
    font-size: 13px;
    color: #5d4037;
}
.fac-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: #f57c00;
}
.fac-body { color: var(--gray-700); line-height: 1.5; }

/* ============================================
   Page Utilisateurs (admin)
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.alert-error   { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6cb; }

.users-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 980px) { .users-grid { grid-template-columns: 1fr; } }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.users-grid .field { display: block; margin-bottom: 10px; }
.users-grid .field-label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.users-grid .field-label small { font-weight: 400; color: var(--gray-500); }

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}
.user-item:last-child { border-bottom: none; }
.user-meta { min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; color: var(--gray-900); }
.user-you {
    display: inline-block;
    background: var(--rk-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 99px;
    margin-left: 6px;
    vertical-align: 1px;
}
.user-email { font-size: 12px; color: var(--gray-500); }
.user-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline-flex; margin: 0; }
.select-sm { padding: 5px 26px 5px 9px; font-size: 12px; }
.btn-danger-ghost {
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--gray-500);
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 9px;
    transition: all .15s;
}
.btn-danger-ghost:hover { color: #fff; background: var(--rk-red); border-color: var(--rk-red); }

/* ── Connexions : dernière connexion par compte ── */
.user-lastconn {
    font-size: 11.5px;
    color: var(--gray-500);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.user-lastconn .lastconn-rel { color: var(--gray-400); }
.user-lastconn .lastconn-never { color: var(--gray-400); font-style: italic; }

/* ── Table historique des connexions ── */
.connexions-table { margin-top: 10px; font-size: 13px; }
.cnx-row {
    display: grid;
    grid-template-columns: 1.6fr 1.4fr 1fr;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
}
.cnx-row:last-child { border-bottom: none; }
.cnx-head {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--gray-500);
}
.cnx-user { display: flex; flex-direction: column; min-width: 0; }
.cnx-name { font-weight: 600; color: var(--gray-900); }
.cnx-email { font-size: 12px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; }
.cnx-date { color: var(--gray-700); display: flex; flex-direction: column; }
.cnx-date .cnx-rel { font-size: 11.5px; color: var(--gray-400); }
.cnx-ip { color: var(--gray-500); font-variant-numeric: tabular-nums; }
.muted { color: var(--gray-500); }

@media (max-width: 860px) {
    .cnx-head { display: none; }
    .cnx-row {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 12px 4px;
    }
}

/* Badges type d'activité (connexion vs visite) */
.cnx-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
}
.cnx-type-badge.cnx-login  { background: var(--rk-red-soft); color: var(--rk-red-dark); }
.cnx-type-badge.cnx-visite { background: var(--gray-100); color: var(--gray-600); }

/* Case "Rester connecté" sur le login */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}
.remember-row input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--rk-red);
    cursor: pointer;
}

/* ============================================================
   Responsive formulaire d'ajout — placé en fin de fichier pour
   gagner sur la définition de base .add-grid (3 colonnes) qui,
   étant déclarée après les media queries plus haut, les écrasait.
   ============================================================ */
@media (max-width: 1100px) {
    .add-grid { grid-template-columns: 1fr 1fr; }
    .add-col:nth-child(3) { grid-column: 1 / -1; }
    .add-col:nth-child(3) .map-edit { max-width: 420px; }
}
@media (max-width: 860px) {
    .add-grid { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
    .add-col { grid-column: 1 !important; }
    .add-col:nth-child(3) .map-edit { max-width: none; }
    /* Lignes à 2 champs : on empile sur petit écran */
    .add-grid .form-row,
    .add-grid .form-row-3 { grid-template-columns: 1fr; }
    /* Surfaces : la case + label + champ sur une ligne lisible */
    .surf-check { gap: 10px; }
    .surf-check span { min-width: 70px; }
}
@media (max-width: 480px) {
    .add-grid { padding: 14px; gap: 16px; }
}

/* Badge transaction (À louer / À vendre) sur la fiche */
.transaction-pill {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: 999px;
    padding: 3px 11px;
    margin-bottom: 6px;
    color: #fff;
}
.transaction-pill.tx-location { background: var(--success); }
.transaction-pill.tx-vente    { background: var(--rk-red); }
.transaction-pill.tx-les_deux { background: #8e44ad; }
