/* ============================================================
   DYNASTY 8 — CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* ---- Brand Palette (Deep Forest & Rich Emerald) ---- */
    --g-950: #05190d;
    --g-900: #0b3c1d;
    --g-800: #12542a;
    --g-700: #1b733b;
    --g-600: #26924d;
    --g-500: #34b360;
    --g-400: #62d88a;
    --g-100: #eefbf2;
    --g-tint: rgba(11, 60, 29, 0.85);

    /* ---- Or (accent premium) ---- */
    --gold-700: #a3790f;
    --gold-600: #c9a227;
    --gold-500: #e0a800;
    --gold-400: #f0c419;
    --gold-tint-bg: #fff8e1;
    --gold-tint-border: #ffe082;

    /* ---- Rouges (alertes / suppression) ---- */
    --red-600: #c0392b;
    --red-500: #e74c3c;
    --red-400: #ff4757;

    /* ---- Neutres ---- */
    --ink-900: #1a1a1a;
    --ink-800: #222222;
    --ink-700: #333333;
    --ink-600: #4a4a4a;
    --ink-500: #666666;
    --ink-400: #8a8a8a;
    --ink-300: #aaaaaa;
    --ink-200: #cccccc;
    --border: #e2ddd6;
    --border-soft: #ededed;
    --bg-page: #f4f4f4;
    --bg-alt: #ede9e1;
    --surface: #ffffff;

    /* ---- Typographie ---- */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* ---- Rayons ---- */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-pill: 999px;

    /* ---- Ombres ---- */
    --shadow-xs: 0 1px 4px rgba(20, 20, 20, 0.05);
    --shadow-sm: 0 2px 10px rgba(20, 20, 20, 0.06);
    --shadow-md: 0 6px 20px rgba(20, 20, 20, 0.08);
    --shadow-lg: 0 16px 40px rgba(20, 20, 20, 0.14);

    /* ---- Transitions ---- */
    --ease: cubic-bezier(.22, .8, .22, 1);
    --t-fast: 0.15s ease;
    --t-med: 0.25s var(--ease);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
*::-webkit-scrollbar { display: none; }

body {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-page);
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink-700);
    -webkit-font-smoothing: antialiased;
}

h1 {
    font-family: var(--font-display);
    color: var(--ink-800);
    font-weight: 600;
    font-size: 30px;
    margin-bottom: 20px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.hamburger { display: none; }

.sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(22, 70, 26, 0.979));
    color: white;
    position: fixed;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.logo-section {
    padding: 30px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.logo-section img {
    width: 170px;
    transition: transform var(--t-med);
}
.logo-section img:hover { transform: scale(1.05); }

/* ---- Menu ---- */
.menu-header {
    padding: 24px 20px 8px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255, 255, 255, 0.45);
}

.menu-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background var(--t-fast), padding-left var(--t-fast);
    font-weight: 500;
    font-size: 14.5px;
}
.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 24px;
}
.menu-item i { width: 18px; text-align: center; color: var(--g-400); }
.arrow { margin-left: auto; font-size: 0.75em; transition: transform var(--t-med); opacity: 0.6; }

.submenu { background-color: rgba(0, 0, 0, 0.800); display: none; }
.submenu a {
    display: block;
    padding: 12px 20px 12px 52px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13.5px;
    transition: background var(--t-fast), color var(--t-fast);
    border-left: 3px solid transparent;
}
.submenu a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.15); }
.active-link {
    border-left-color: var(--gold-500) !important;
    color: white !important;
    background: rgba(255, 255, 255, 0.08);
}

/* Neutralise le violet des liens visités dans le menu */
a.menu-item, a.menu-item:visited, a.menu-item:hover, a.menu-item:active {
    color: inherit;
    text-decoration: none;
}

/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */

.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 40px;
    min-height: calc(100vh - 45px);
    position: relative;
    z-index: 1;
    transition: opacity var(--t-fast);
}

/* Anti-flash carte */
html.preload-carte #page-content { display: none; }

/* ============================================================
   HOMEPAGE — HERO
   ============================================================ */

.home-page {
    padding: 0 !important;
    background: var(--bg-page);
    overflow-y: auto;
}

.hp-hero {
    position: relative;
    height: 68vh;
    min-height: 420px;
    max-height: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hp-hero-bg {
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?w=1400&q=80') center/cover no-repeat;
    transform: scale(1.04);
    animation: heroZoom 18s ease-in-out infinite alternate;
}
@keyframes heroZoom {
    from { transform: scale(1.04); }
    to   { transform: scale(1.12); }
}

.hp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(3, 27, 12, 0.78) 0%,
        rgba(4, 68, 25, 0.45) 55%,
        rgba(244, 244, 244, 0.85) 100%
    );
}

.hp-hero-body {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 32px;
    animation: hpFadeUp 0.85s var(--ease) both;
}
@keyframes hpFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hp-hero-eyebrow {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: var(--gold-400);
    margin-bottom: 14px;
}

.hp-hero-title {
    font-family: var(--font-display);
    font-size: clamp(56px, 7vw, 96px);
    font-weight: 400;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
    margin: 0;
}
.hp-hero-title em {
    color: var(--g-400);
    font-style: italic;
}

.hp-hero-sub {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 18px;
    line-height: 1.7;
}

/* ---- Barre de stats ---- */
.hp-stats {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 18px 40px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.07);
    animation: hpFadeUp 0.85s 0.2s var(--ease) both;
    flex-wrap: wrap;
    gap: 0;
}

.hp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 36px;
    flex: 1;
    min-width: 110px;
}
.hp-stat-num {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 600;
    color: var(--g-900);
    line-height: 1;
}
.hp-stat-plus {
    font-size: 22px;
    vertical-align: super;
    color: var(--g-500);
}
.hp-stat-lbl {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--ink-400);
    letter-spacing: 0.5px;
    margin-top: 5px;
    text-transform: uppercase;
    font-weight: 500;
}
.hp-stat-sep {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
}

/* ============================================================
   HOMEPAGE — À PROPOS
   ============================================================ */

.hp-about {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    padding: 68px 56px;
    background: var(--bg-alt);
    flex-wrap: wrap;
}

.hp-about-text {
    flex: 1;
    min-width: 240px;
    max-width: 380px;
}
.hp-about-text h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 400;
    color: var(--ink-900);
    line-height: 1.15;
    margin-bottom: 22px;
}
.hp-about-text h2 em {
    font-style: italic;
    color: var(--g-700);
}
.hp-about-text p {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.85;
    color: var(--ink-500);
    font-weight: 300;
}

.hp-about-cards {
    flex: 2;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: stretch;
}
.hp-about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 30px 22px;
    flex: 1;
    min-width: 140px;
    transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.hp-about-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(46, 125, 50, 0.25);
}
.hp-about-card-icon { font-size: 26px; margin-bottom: 14px; }
.hp-about-card h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 8px;
}
.hp-about-card p {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink-400);
    line-height: 1.65;
}

/* ============================================================
   HOMEPAGE — ACTUALITÉS
   ============================================================ */

.hp-news { padding: 40px 56px 56px; background: var(--bg-page); }
.hp-news-title {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-400);
    margin-bottom: 16px;
}
.hp-news-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--g-500);
    border-radius: var(--r-md);
    padding: 20px 24px;
    max-width: 620px;
    box-shadow: var(--shadow-xs);
}
.hp-news-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--g-500);
    flex-shrink: 0;
    margin-top: 6px;
}
.hp-news-card p {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink-600);
    line-height: 1.7;
}

/* ============================================================
   ACTIONS EN TÊTE DE PAGE
   ============================================================ */

.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-add {
    background: var(--ink-500);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background var(--t-fast), transform var(--t-fast);
}
.btn-add:hover { background: var(--ink-700); transform: translateY(-1px); }

/* ============================================================
   TABLEAUX
   ============================================================ */

.sales-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: var(--r-md);
    overflow: hidden;
}
.sales-table th {
    background: #f8f8f8;
    padding: 15px;
    text-align: left;
    color: var(--ink-500);
    border-bottom: 2px solid var(--border-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.sales-table td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink-700);
    vertical-align: middle;
    font-size: 13.5px;
}
.sales-table tbody tr:last-child td { border-bottom: none; }
.sales-table tbody tr { transition: background var(--t-fast); }
.sales-table tbody tr:hover { background: #fafafa; }

/* Ligne log avec bordure colorée gauche */
#logsTable tbody tr {
    border-left-width: 3px;
    border-left-style: solid;
}

/* ============================================================
   STAT CARDS (résumés / KPI simples)
   ============================================================ */

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    box-shadow: var(--shadow-xs);
}
.stat-label {
    font-size: 11px;
    color: var(--ink-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}
.stat-value { font-size: 20px; font-weight: 700; color: var(--g-900); }

/* ============================================================
   BADGES & RÔLES
   ============================================================ */

.badge, .role-editor-select {
    padding: 4px 11px;
    border-radius: var(--r-xs);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: inline-block;
    border: none;
}
.badge.owner, .role-editor-select.owner { background-color: var(--red-400); color: white; }
.badge.hg,    .role-editor-select.hg    { background-color: #9b59b6; color: white; }
.badge.staff, .role-editor-select.staff { background-color: #2f3542; color: white; }
.badge.agent, .role-editor-select.agent { background-color: #2ed573; color: white; }
.badge.decorateur, .role-editor-select.decorateur { background-color: #afb3db; color: white; }

.role-editor-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    outline: none;
}
.role-editor-select option {
    background-color: white !important;
    color: var(--ink-700) !important;
    font-weight: normal;
    text-transform: none;
}

/* ============================================================
   BOUTONS D'ACTIONS
   ============================================================ */

.btn-delete {
    color: var(--red-400);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: opacity var(--t-fast);
}
.btn-delete:hover { text-decoration: underline; opacity: 0.85; }

.btn-incoherence {
    background: none;
    border: 1px solid var(--gold-500);
    color: var(--gold-500);
    border-radius: var(--r-xs);
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast);
}
.btn-incoherence-active {
    background: var(--gold-500) !important;
    color: #000 !important;
    font-weight: bold;
}

.btn-pdf {
    background: none;
    border: 1px solid var(--g-600);
    color: var(--g-600);
    border-radius: var(--r-xs);
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast);
}
.btn-pdf:hover { background: var(--g-600); color: white; }

.action-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background var(--t-fast);
}
.action-item:hover { background: #f5f5f5; }

/* ============================================================
   FILTRES & DATES
   ============================================================ */

#filterGrade, #filterVentes {
    background-color: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
}

.date-filter-group {
    background: #eeeeee;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    font-size: 14px;
    color: var(--ink-700);
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-filter-group input[type="date"] {
    border: 1px solid var(--ink-200);
    border-radius: var(--r-xs);
    padding: 3px;
    background: white;
    margin: 0;
}

/* ============================================================
   MODALE GÉNÉRIQUE
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
}
.modal-content {
    background: var(--surface);
    margin: 8% auto;
    padding: 32px;
    border-radius: var(--r-lg);
    width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.modal-content h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--g-900);
    margin-bottom: 18px;
}
.close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: var(--ink-400);
    transition: color var(--t-fast);
}
.close:hover { color: var(--red-400); }

input, select {
    width: 100%;
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    font-size: 14px;
    color: var(--ink-700);
    background: var(--surface);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--g-600);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.btn-save {
    width: 100%;
    background: var(--g-900);
    color: white;
    border: none;
    padding: 13px;
    margin-top: 14px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: var(--r-xs);
    font-size: 15px;
    transition: background var(--t-fast), transform var(--t-fast);
}
.btn-save:hover { background: #033012; transform: translateY(-1px); }

.input-readonly {
    background-color: #f9f9f9 !important;
    color: var(--ink-200) !important;
    cursor: not-allowed !important;
    border-color: var(--border-soft) !important;
}

/* ---- Badge & champ commission ---- */
.commission-badge {
    display: inline-block;
    background: var(--gold-tint-bg);
    color: var(--gold-500);
    border: 1px solid var(--gold-tint-border);
    border-radius: var(--r-xs);
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.commission-field {
    background-color: var(--gold-tint-bg) !important;
    color: #c8900a !important;
    border-color: var(--gold-tint-border) !important;
    font-weight: 700;
}

/* ============================================================
   GRILLE DES CATALOGUES
   ============================================================ */

.grille-interieurs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-top: 20px;
}

.carte-bien {
    background: var(--surface);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform var(--t-med), box-shadow var(--t-med);
}
.carte-bien:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.carte-bien img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
.infos { padding: 12px; text-align: center; }
.infos h3 { font-size: 14px; margin-bottom: 4px; color: var(--ink-800); }
.infos p  { font-size: 12px; color: var(--ink-500); }

/* ============================================================
   ZOOM IMAGE (conteneur — le contenu est injecté par le JS)
   ============================================================ */

#imageModal {
    display: none;
    position: fixed;
    z-index: 999999;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 20px;
}

/* ============================================================
   CARTE INTERACTIVE
   ============================================================ */

.page-section { padding: 20px; }

#Carte {
    position: fixed;
    top: 0;
    left: 280px;
    width: calc(100% - 280px);
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    z-index: 10;
    transition: left var(--t-med), width var(--t-med);
}
#Carte.fullscreen { left: 0; width: 100%; }

.map-controls {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.map-controls button {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--t-fast);
}
.map-controls button:hover { background: rgba(255, 71, 87, 0.85); }

.map-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #17406e;
    cursor: grab;
    border: 2px solid #222;
}
.map-content { position: absolute; transform-origin: 0 0; will-change: transform; }
.map-content img {
    display: block;
    height: 1000px;
    width: auto;
    user-select: none;
    -webkit-user-drag: none;
}
.map-svg-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.map-zone {
    pointer-events: all;
    fill: transparent;
    stroke-width: 2;
    cursor: pointer;
    transition: fill var(--t-fast);
}
.zone-or     { fill: rgba(180, 150, 30, 0.4);  stroke: #c8a820; }
.zone-vert   { fill: rgba(60, 130, 70, 0.4);   stroke: #3a8246; }
.zone-rouge  { fill: rgba(140, 40, 40, 0.4);   stroke: #8b2020; }
.zone-violet { fill: rgba(130, 50, 130, 0.4);  stroke: #7a2e7a; }
.zone-bleu   { fill: rgba(50, 100, 200, 0.4);  stroke: #3264c8; }
.zone-orange { fill: rgba(228, 114, 7, 0.4);   stroke: #c77c1a; }
.zone-or:hover     { fill: rgba(180, 150, 30, 0.65); }
.zone-vert:hover   { fill: rgba(60, 130, 70, 0.65); }
.zone-rouge:hover  { fill: rgba(140, 40, 40, 0.65); }
.zone-violet:hover { fill: rgba(130, 50, 130, 0.65); }
.zone-bleu:hover   { fill: rgba(50, 100, 200, 0.65); }
.zone-orange:hover { fill: rgba(228, 114, 7, 0.65); }

.map-x line {
    stroke: #ff2020;
    stroke-width: 10;
    stroke-linecap: round;
    pointer-events: none;
}

.zone-tooltip {
    display: none;
    position: fixed;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.88);
    color: white;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   MODALE RESSOURCES (overlay custom)
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-container {
    background: rgba(10, 20, 12, 0.55);
    padding: 32px;
    border-radius: var(--r-xl);
    width: 370px;
    border: 1px solid var(--g-500);
    text-align: center;
}
.modal-title {
    font-family: var(--font-display);
    color: white;
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 14px;
}
.modal-link {
    display: block;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    padding: 12px;
    margin: 10px 0;
    border-radius: var(--r-md);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background var(--t-fast), border-color var(--t-fast);
}
.modal-link:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--g-500); }
.modal-close {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 9px 22px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 14px;
    width: auto;
    transition: background var(--t-fast);
}
.modal-close:hover { background: rgba(255, 255, 255, 0.16); }

/* ============================================================
   PAGE STATISTIQUES
   ============================================================ */

.stats-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ink-400);
    margin: 0 0 12px;
    font-weight: 700;
    padding-left: 2px;
}

.stats-grid-kpi {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.stats-kpi-card {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-xs);
    border-left: 4px solid #ddd;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.stats-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stats-kpi-card.accent-green  { border-left-color: var(--g-600); }
.stats-kpi-card.accent-gold   { border-left-color: var(--gold-500); }
.stats-kpi-card.accent-orange { border-left-color: #f57c00; }
.stats-kpi-card.accent-red    { border-left-color: #c62828; }
.stats-kpi-card.accent-blue   { border-left-color: #1565c0; }
.stats-kpi-card.accent-purple { border-left-color: #6a1b9a; }

.kpi-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label {
    font-size: 11px;
    color: var(--ink-400);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink-800);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-sub {
    font-size: 11px;
    color: var(--ink-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-panel {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 0;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.stats-panel-title {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-700);
    background: #f8f8f8;
    border-bottom: 2px solid var(--border-soft);
    letter-spacing: 0.3px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.cat-footer {
    display: none;
    margin-left: 280px;
    background: #f7f5f0;
    border-top: 1px solid var(--border);
    padding: 11px 40px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--ink-500);
    font-family: var(--font-body);
}
.cat-footer.visible { display: flex; }

/* ============================================================
   FICHE BIEN (ZOOM) — CARTE PREMIUM
   ============================================================ */

.zoom-card {
    background: var(--surface);
    border-radius: var(--r-xl);
    overflow-y: auto;
    max-width: 1000px;
    max-height: 90vh;
    margin: 0 auto;
    text-align: left;
    box-shadow: var(--shadow-lg);
}
.zoom-card-media { position: relative; }
.zoom-card-media img {
    width: 100%;
    max-height: 55vh;
    object-fit: cover;
    display: block;
}
.zoom-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.75) 100%);
    pointer-events: none;
}
.zoom-card-media-title {
    position: absolute;
    left: 18px;
    bottom: 14px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    z-index: 1;
}

.zoom-media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast);
}
.zoom-media-nav:hover { background: rgba(0, 0, 0, 0.7); }
.zoom-media-nav.prev { left: 14px; }
.zoom-media-nav.next { right: 14px; }

.zoom-media-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.zoom-media-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background var(--t-fast), transform var(--t-fast);
}
.zoom-media-dots .dot.active {
    background: #fff;
    transform: scale(1.2);
}

.zoom-card-body { padding: 18px 20px 22px; background: var(--surface); }

.zoom-price-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.zoom-price-pill {
    flex: 1;
    min-width: 90px;
    background: var(--bg-page);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 8px 12px;
}
.zoom-price-pill span { display: block; }
.zoom-price-pill .lbl { font-size: 11px; color: var(--ink-400); margin-bottom: 2px; }
.zoom-price-pill .val { font-size: 14px; color: var(--ink-900); font-weight: 600; }

.taxe-note { font-size: 9px; color: var(--ink-300); font-weight: 400; }

.zoom-price-pill .val-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}
.zoom-price-pill .val-ht {
    color: var(--ink-900);
}
.zoom-price-pill .val-ttc {
    font-weight: 700;
}
.zoom-price-pill.achat .val-ttc    { color: var(--red-600); }
.zoom-price-pill.location .val-ttc { color: var(--g-700); }
.zoom-price-pill .sep {
    color: var(--ink-300);
    font-weight: 400;
}

.zoom-taxe-settings-btn {
    display: block;
    margin: 0 0 10px auto;
    background: none;
    border: 1px solid var(--border);
    color: var(--ink-500);
    border-radius: var(--r-sm);
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
}
.zoom-taxe-settings-btn:hover { background: var(--bg-page); }

.zoom-zones { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.zone-chip {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: var(--r-pill);
    border: 1px solid var(--zone-color, #999);
    color: var(--zone-color, #999);
    font-weight: 600;
    white-space: nowrap;
}

.zoom-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.zoom-actions button {
    flex: 1;
    min-width: 130px;
    border: none;
    border-radius: var(--r-md);
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
    transition: filter var(--t-fast);
}
.zoom-actions button:hover { filter: brightness(1.12); }
.btn-zoom-loc   { background: var(--g-600); }
.btn-zoom-vente { background: var(--red-600); }

.zoom-deco-section {
    border-top: 1px solid var(--border-soft);
    padding-top: 14px;
}
.zoom-deco-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    color: var(--ink-800);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.zoom-deco-toggle span {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--gold-500);
    text-decoration-thickness: 2px;
}
.zoom-deco-toggle .chevron { transition: transform var(--t-med); color: var(--ink-400); }
.zoom-deco-toggle.open .chevron { transform: rotate(180deg); }
.zoom-deco-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease);
    position: relative;
}
.zoom-deco-panel.open {
    max-height: 2000px;
    padding-top: 12px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--gold-500);
}
.zoom-deco-underline { display: none; } /* remplacé par border-bottom ci-dessus */

.zoom-deco-list-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}
.zoom-deco-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    scrollbar-width: thin;              /* réactive la scrollbar Firefox */
    scrollbar-color: var(--gold-500) transparent;
}
.zoom-deco-list::-webkit-scrollbar {
    display: block;                     /* réactive la scrollbar Chrome/Safari */
    height: 8px;
}
.zoom-deco-list::-webkit-scrollbar-thumb {
    background: var(--gold-500);
    border-radius: 4px;
}
.zoom-deco-list::-webkit-scrollbar-track {
    background: var(--border-soft);
    border-radius: 4px;
}
.zoom-deco-nav {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-600);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
    transition: background var(--t-fast);
}
.zoom-deco-nav:hover { background: var(--bg-page); }

.zoom-deco-empty { color: var(--ink-300); font-size: 12px; padding: 8px 0; }

.zoom-deco-add-btn {
    margin-top: 10px;
    background: none;
    border: 1px dashed var(--gold-tint-border);
    color: var(--gold-500);
    border-radius: var(--r-md);
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
}

.deco-type-switch {
    display: none;
    gap: 4px;
    background: var(--bg-page);
    border-radius: var(--r-pill);
    padding: 4px;
    margin-top: 14px;
    width: fit-content;
}
.deco-type-btn {
    border: none;
    background: none;
    padding: 7px 18px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-500);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.deco-type-btn.active {
    background: var(--gold-500);
    color: #1a1a1a;
}

.yt-embed-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.yt-embed-action-btn {
    flex: 1;
    background: rgba(0,0,0,0.55);
    border: none;
    color: #ff4757;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: filter var(--t-fast);
}
.yt-embed-action-btn:hover { filter: brightness(1.3); }
.yt-embed-action-btn.modif { color: #6ea8ff; }

.zoom-deco-form-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.zoom-deco-form-row input {
    flex: 1; min-width: 140px; margin: 0;
    font-size: 13px;
}
.zoom-deco-form-row button {
    background: var(--g-600); color: #fff; border: none;
    border-radius: var(--r-sm); padding: 0 14px; cursor: pointer; font-weight: 600;
}

.yt-embed {
    position: relative;
    background: var(--bg-page);
    border: 1px solid var(--border-soft);
    border-left: 4px solid #5865F2;
    border-radius: var(--r-sm);
    padding: 12px 14px;
    margin-bottom: 0;
}
.yt-embed-site { font-size: 11px; color: var(--ink-400); text-decoration: none; display: block; }
.yt-embed-author, .yt-embed-title {
    display: block; font-size: 13px; text-decoration: none; font-weight: 600;
}
.yt-embed-author { color: #4f6bd8; }
.yt-embed-title { color: var(--ink-900); }
.yt-embed-thumb-wrap {
    position: relative;
    margin-top: 8px;
    border-radius: var(--r-sm);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    cursor: pointer;
}
.yt-embed-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-embed-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); color: #fff; font-size: 28px;
}
.yt-embed-delete {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,0.55); border: none; color: #ff4757;
    border-radius: 4px; padding: 4px 7px; cursor: pointer; font-size: 12px;
}

.zoom-close-hint {
    color: var(--ink-300);
    font-size: 12px;
    text-align: center;
    margin-top: 14px;
}

.carte-enchere .enchere-actions {
    display: flex;
    gap: 6px;
    padding: 0 12px 12px;
    flex-wrap: wrap;
}
.badge-enchere-statut {
    position: absolute;
    top: 8px; left: 8px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 2;
}
.carte-enchere.enchere-vendue { opacity: 0.7; }

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.config-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 20px;
    box-shadow: var(--shadow-xs);
}
.config-card h3 {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--ink-900);
    margin-bottom: 6px;
}
.config-card p {
    font-size: 12.5px;
    color: var(--ink-400);
    line-height: 1.5;
}

.config-kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.config-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 20px;
    box-shadow: var(--shadow-xs);
}
.config-card h3 {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--ink-900);
    margin-bottom: 6px;
}
.config-card p {
    font-size: 12.5px;
    color: var(--ink-400);
    line-height: 1.5;
}

.maint-toggle-wrap {
    position: fixed; top: 12px; right: 20px; z-index: 100000;
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.78); padding: 8px 14px; border-radius: 30px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.maint-toggle-label { font-size: 11.5px; font-weight: 700; color: #fff; white-space: nowrap; }
.maint-switch {
    position: relative; width: 50px; height: 26px; border-radius: 20px;
    background: #2ecc71; cursor: pointer; transition: background .25s; flex-shrink: 0;
}
.maint-switch.active { background: #e74c3c; }
.maint-switch .knob {
    position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; transition: left .25s;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.maint-switch.active .knob { left: 27px; }

@media (max-width: 768px) {
    .maint-toggle-wrap { top: auto; bottom: 14px; right: 14px; }
}

.btn-cancel-red {
    padding: 10px 20px; border: none; background: var(--red-500); color: white;
    border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14px;
    transition: background var(--t-fast);
}
.btn-cancel-red:hover { background: var(--red-600); }

.btn-confirm-green {
    padding: 10px 20px; border: none; background: var(--g-900); color: white;
    border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14px;
    transition: background var(--t-fast);
}
.btn-confirm-green:hover { background: #033012; }

/* ============================================================
   RESPONSIVE — DESKTOP → TABLETTE
   ============================================================ */

@media (max-width: 1400px) {
    .stats-grid-kpi { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1200px) {
    .grille-interieurs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .grille-interieurs { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 20px; }
    .stats-grid-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; }
    .grille-interieurs { grid-template-columns: 1fr; }
    .modal-content { width: 95vw; margin: 5% auto; }
    .stats-grid-kpi { grid-template-columns: 1fr; }
    .zoom-card { max-width: 100%; }
    .zoom-actions button { min-width: 100%; }
}

/* ============================================================
   RESPONSIVE — MOBILE (< 768px)
   ============================================================ */

@media (max-width: 768px) {

    /* Sidebar en tiroir */
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--t-med);
        z-index: 1000;
        width: 260px;
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    .sidebar-overlay.visible { display: block; }

    .hamburger {
        display: flex;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1001;
        background: var(--g-tint);
        color: white;
        border: none;
        border-radius: var(--r-sm);
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }

    .main-content { margin-left: 0; padding: 60px 14px 14px; }
    .cat-footer { margin-left: 0; }
    #Carte { left: 0; width: 100%; }

    .header-action { flex-direction: column; align-items: flex-start; }
    .header-action > div { width: 100%; flex-wrap: wrap; gap: 8px; }
    .header-action input[type="text"] { width: 100% !important; }

    /* ---- Tableau -> Cartes empilées ---- */
    .sales-table thead { display: none; }

    .sales-table,
    .sales-table tbody,
    .sales-table tr,
    .sales-table td {
        display: block;
        width: 100%;
        white-space: normal;
    }

    .sales-table {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .sales-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border-soft);
        border-radius: var(--r-md);
        padding: 12px;
        box-shadow: var(--shadow-xs);
        background: var(--surface);
    }

    .sales-table td {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border: none;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    font-size: 13px;
    }

    .sales-table tr td:last-child { border-bottom: none; }

    .sales-table td[data-label="Actions"] {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding-top: 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .sales-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--ink-400);
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-right: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .sales-table td[data-label="Actions"]::before { display: none; }

    .stats-panel + .stats-panel { margin-top: 16px; }

    #ventes-summary { flex-wrap: wrap; }
    .stat-card { flex: 1 1 120px; }

    .hp-hero { height: 50vh; min-height: 300px; }
    .hp-hero-title { font-size: clamp(36px, 10vw, 56px); }
    .hp-stats { flex-wrap: wrap; gap: 8px; padding: 12px 16px; justify-content: center; }
    .hp-stat-sep { display: none; }
    .hp-stat { padding: 4px 0; }
    .hp-about { padding: 24px 16px; gap: 24px; }
    .hp-news { padding: 24px 16px; }

    .grille-interieurs { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .modal-content { width: 95vw; margin: 10% auto; }

    .carte-bien img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        display: block;
        cursor: pointer;
    }

    .zoom-price-row {
        flex-direction: column;
        gap: 6px;
    }
    .zoom-price-pill {
        min-width: 100%;
        width: 100%;
    }
    .zoom-price-pill .val-line {
        flex-wrap: wrap;
        font-size: 13px;
    }
    .zoom-card {
        max-height: 92vh;
    }
    .filtres-tous-row {
        gap: 8px !important;
    }
    .filtres-tous-row > div:first-child {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        order: -1;
    }
    #filtreTypeTous,
    #filtreDecoTous {
        flex: 1 1 calc(50% - 4px) !important;
        width: auto !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
    .filtre-mini {
        flex: 1 1 calc(50% - 4px) !important;
    }
    .filtre-mini span {
        font-size: 11px !important;
    }
    .filtre-mini input {
        width: 100% !important;
        padding: 8px !important;
        font-size: 12px !important;
    }

    /* ---- Bandeau taxe + gestion biens sur mobile ---- */
    .taxe-banner {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .btn-taxe {
        width: 100% !important;
        justify-content: center !important;
        font-size: 13px !important;
        padding: 10px 14px !important;
        text-align: center;
    }
    .taxe-banner .btn-add {
        flex: 1 1 calc(50% - 4px) !important;
        margin-left: 0 !important;
        font-size: 11px !important;
        padding: 9px 10px !important;
        text-align: center;
        white-space: normal !important;
    }
    #decoRecherche,
    #decoSelectCategorie,
    #decoSelectDecorateur {
        width: 100% !important;
        margin: 0 !important;
    }
}