/* ============================================================
   DYNASTY 8 — STYLES  (version optimisée + HG + Logs)
   ============================================================ */

/* --- 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: #f4f4f4;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: #044419c0;
    color: white;
    position: fixed;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.logo-section {
    padding: 30px 20px;
    text-align: center;
    background: rgba(0,0,0,0.1);
    cursor: pointer;
}
.logo-section img {
    width: 180px;
    transition: transform 0.3s;
}
.logo-section img:hover { transform: scale(1.05); }

/* --- MENU --- */
.menu-header {
    padding: 25px 20px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.5);
}

.menu-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
    font-weight: 500;
}
.menu-item:hover { background: rgba(255,255,255,0.15); }
.menu-item i { margin-right: 15px; width: 20px; text-align: center; }
.arrow { margin-left: auto; font-size: 0.8em; transition: transform 0.3s; }

.submenu { background-color: #333; display: none; }
.submenu a {
    display: block;
    padding: 12px 50px;
    color: #bbb;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    border-left: 5px solid transparent;
}
.submenu a:hover { color: white; background: #444; }
.active-link { border-left-color: #c3cf14da !important; color: white !important; background: #3d3d3d; }

/* --- CONTENU PRINCIPAL --- */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 40px;
    min-height: calc(100vh - 45px);
    position: relative;
    z-index: 1;
    transition: opacity 0.2s;
}

h1 { color: #333; margin-bottom: 20px; }

/* ============================================================
   DYNASTY 8 — HOMEPAGE REDESIGN
   Coller à la FIN de style.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&display=swap');

/* ── Reset padding sur la homepage ── */
.home-page {
    padding: 0 !important;
    background: #f4f4f4;
    overflow-y: auto;
}

/* ══════════════════════════════════════════
   HERO
   ══════════════════════════════════════════ */
.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.10); }
}

.hp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(10, 36, 14, 0.72) 0%,
        rgba(10, 36, 14, 0.48) 55%,
        rgba(244, 244, 244, 0.82) 100%
    );
}

.hp-hero-body {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 32px;
    animation: hpFadeUp 0.85s cubic-bezier(.22,.8,.22,1) both;
}
@keyframes hpFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hp-hero-eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin-bottom: 12px;
}

.hp-hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    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.22);
    margin: 0;
}
.hp-hero-title em {
    color: #7ed87e;
    font-style: italic;
}

.hp-hero-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: rgba(255,255,255,0.82);
    margin-top: 16px;
    line-height: 1.65;
}

/* ── Stats bar ── */
.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(8px);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 18px 40px;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
    animation: hpFadeUp 0.85s 0.2s cubic-bezier(.22,.8,.22,1) 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: 'Cormorant Garamond', Georgia, serif;
    font-size: 36px;
    font-weight: 600;
    color: #1a3d1f;
    line-height: 1;
}
.hp-stat-plus {
    font-size: 22px;
    vertical-align: super;
    color: #3d8c45;
}
.hp-stat-lbl {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: #8a8a8a;
    letter-spacing: 0.4px;
    margin-top: 4px;
    text-transform: uppercase;
}
.hp-stat-sep {
    width: 1px;
    height: 36px;
    background: #e2ddd6;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   À PROPOS
   ══════════════════════════════════════════ */
.hp-about {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    padding: 64px 56px;
    background: #ede9e1;
    flex-wrap: wrap;
}

.hp-about-text {
    flex: 1;
    min-width: 240px;
    max-width: 380px;
}
.hp-about-text h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 400;
    color: #1c1c1c;
    line-height: 1.15;
    margin-bottom: 20px;
}
.hp-about-text h2 em {
    font-style: italic;
    color: #2e6b34;
}
.hp-about-text p {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #5a5a5a;
    font-weight: 300;
}

.hp-about-cards {
    flex: 2;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: stretch;
}
.hp-about-card {
    background: #ffffff;
    border: 1px solid #e2ddd6;
    border-radius: 14px;
    padding: 28px 22px;
    flex: 1;
    min-width: 140px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hp-about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(45,107,52,0.10);
}
.hp-about-card-icon {
    font-size: 26px;
    margin-bottom: 12px;
}
.hp-about-card h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    font-weight: 500;
    color: #1c1c1c;
    margin-bottom: 8px;
}
.hp-about-card p {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #8a8a8a;
    line-height: 1.6;
}

/* ══════════════════════════════════════════
   ACTUALITÉS
   ══════════════════════════════════════════ */
.hp-news {
    padding: 40px 56px 56px;
    background: #f4f4f4;
}
.hp-news-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #8a8a8a;
    margin-bottom: 16px;
}
.hp-news-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e2ddd6;
    border-left: 4px solid #3d8c45;
    border-radius: 10px;
    padding: 20px 24px;
    max-width: 620px;
}
.hp-news-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #3d8c45;
    flex-shrink: 0;
    margin-top: 6px;
}
.hp-news-card p {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.65;
}

/* --- ACTIONS EN TÊTE --- */
.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-add {
    background: #666;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}
.btn-add:hover { background: #444; }

/* --- TABLEAU --- */
.sales-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
}
.sales-table th {
    background: #f8f8f8;
    padding: 15px;
    text-align: left;
    color: #666;
    border-bottom: 2px solid #eee;
    font-size: 13px;
    text-transform: uppercase;
}
.sales-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    vertical-align: middle;
}
.sales-table tbody tr:last-child td { border-bottom: none; }
.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é ventes) --- */
.stat-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.stat-label { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: 0.8px; }
.stat-value { font-size: 20px; font-weight: 600; color: #044419; }

/* --- BADGES & RÔLES --- */
.badge, .role-editor-select {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    border: none;
}
.badge.owner, .role-editor-select.owner { background-color: #ff4757; 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; }

.role-editor-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    outline: none;
}
.role-editor-select option {
    background-color: white !important;
    color: #333 !important;
    font-weight: normal;
    text-transform: none;
}

/* --- BOUTONS ACTIONS --- */
.btn-delete {
    color: #ff4757;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}
.btn-delete:hover { text-decoration: underline; }

.btn-incoherence {
    background: none;
    border: 1px solid #e0a800;
    color: #e0a800;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.btn-incoherence-active {
    background: #e0a800 !important;
    color: #000 !important;
    font-weight: bold;
}

.btn-pdf {
    background: none;
    border: 1px solid #2e7d32;
    color: #2e7d32;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.btn-pdf:hover { background: #2e7d32; color: white; }

/* --- FILTRES DATE --- */
#filterGrade, #filterVentes {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 500;
}

.date-filter-group {
    background: #eee;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-filter-group input[type="date"] {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 3px;
    background: white;
}

/* --- MODALE GÉNÉRIQUE --- */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    inset: 0;
    background: rgba(0,0,0,0.7);
}
.modal-content {
    background: white;
    margin: 8% auto;
    padding: 30px;
    border-radius: 8px;
    width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.close:hover { color: #ff4757; }

input, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
input:focus, select:focus { outline: 2px solid #2e7d32; outline-offset: 0; }

.btn-save {
    width: 100%;
    background: #044419;
    color: white;
    border: none;
    padding: 12px;
    margin-top: 12px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    font-size: 15px;
    transition: background 0.2s;
}
.btn-save:hover { background: #033012; }

.input-readonly {
    background-color: #f9f9f9 !important;
    color: #aaa !important;
    cursor: not-allowed !important;
    border-color: #eee !important;
}

/* --- GRILLE CATALOGUES --- */
.grille-interieurs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-top: 20px;
}

.carte-bien {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.carte-bien:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.carte-bien img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
.infos { padding: 10px; text-align: center; }
.infos h3 { font-size: 14px; margin-bottom: 4px; }
.infos p  { font-size: 12px; color: #666; }

/* --- ZOOM IMAGE --- */
#imageModal {
    display: none;
    position: fixed;
    z-index: 999999;
    inset: 0;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- 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 0.3s, width 0.3s;
}

#Carte.fullscreen {
    left: 0;
    width: 100%;
}

.map-controls {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 100;
}
.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;
    transition: background 0.2s;
}
.map-controls button:hover { background: rgba(255,71,87,0.8); }

.map-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #17406e;
    cursor: grab;
    border: 2px solid #333;
}

.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 0.2s;
}

.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;
}

/* --- MODALE RESSOURCES (overlay custom) --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-container {
    background: rgba(0,0,0,0.4);
    padding: 30px;
    border-radius: 15px;
    width: 370px;
    border: 1px solid #2e9121;
    text-align: center;
}
.modal-title { color: white; font-size: 20px; margin-bottom: 12px; }
.modal-link {
    display: block;
    background: #222;
    color: white;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #444;
    transition: background 0.2s, border-color 0.2s;
}
.modal-link:hover { background: #333; border-color: #2e9121; }
.modal-close {
    margin-top: 15px;
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    width: auto;
    transition: background 0.2s;
}
.modal-close:hover { background: #444; }

/* --- RESPONSIVE --- */
@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; }
}
@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; }
}

/* ============================================================
   DYNASTY 8 — AJOUTS CSS (à coller en bas de style.css)
   ============================================================ */

/* --- BADGE COMMISSION --- */
.commission-badge {
    display: inline-block;
    background: #fff8e1;
    color: #e0a800;
    border: 1px solid #ffe082;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

/* --- CHAMP COMMISSION DANS MODALE --- */
.commission-field {
    background-color: #fff8e1 !important;
    color: #c8900a !important;
    border-color: #ffe082 !important;
    font-weight: bold;
}

/* ============================================================
   PAGE STATISTIQUES
   ============================================================ */

/* Titre de section */
.stats-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin: 0 0 12px;
    font-weight: 700;
    padding-left: 2px;
}

/* Grille des KPI cards */
.stats-grid-kpi {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* Carte KPI */
.stats-kpi-card {
    background: white;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #ddd;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stats-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.stats-kpi-card.accent-green  { border-left-color: #2e7d32; }
.stats-kpi-card.accent-gold   { border-left-color: #e0a800; }
.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: #999;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-sub {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Panel conteneur (classement, top biens, récap) */
.stats-panel {
    background: white;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.stats-panel-title {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    background: #f8f8f8;
    border-bottom: 2px solid #eee;
    letter-spacing: 0.3px;
}

/* Responsive stats */

@media (max-width: 1400px) {
    .stats-grid-kpi { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .stats-grid-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .stats-grid-kpi { grid-template-columns: 1fr; }
}

.cat-footer {
    margin-left: 280px;
    background: #f7f5f0;
    border-top: 1px solid #e2ddd6;
    padding: 11px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #000000;
    font-family: 'DM Sans', sans-serif;
}

.cat-footer.hidden {
    display: none !important;
}