/* ===== VARIABLES & RESET ===== */
:root {
    --blue: #4361EE;
    --blue-dark: #3651D4;
    --blue-light: #EEF1FD;
    --blue-50: #f0f3ff;
    --beige: #F5F0EB;
    --beige-light: #FAF7F4;
    --white: #FFFFFF;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --green: #22c55e;
    --green-light: #f0fdf4;
    --red: #ef4444;
    --red-light: #fef2f2;
    --orange: #f59e0b;
    --orange-light: #fffbeb;
    --purple: #a855f7;
    --purple-light: #faf5ff;
    --sidebar-width: 220px;
    --sidebar-collapsed: 64px;
    --topbar-height: 56px;
    --primary: #4361EE;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--beige-light);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
#sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition);
}

.sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
}

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

.logo-icon {
    width: 32px;
    height: 38px;
    flex-shrink: 0;
}
.logo-full {
    width: 180px;
    height: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 400;
}

.nav-menu {
    flex: 1;
    list-style: none;
    padding: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    user-select: none;
}

.nav-item:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.nav-item.active {
    background: var(--blue);
    color: var(--white);
}

.nav-item .material-icons-outlined {
    font-size: 20px;
}

.nav-separator {
    height: 1px;
    background: var(--gray-200);
    margin: 8px 12px;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 10px;
}
.logout-btn {
    margin-left: auto;
    color: var(--gray-400);
    transition: color 0.2s;
}
.logout-btn:hover { color: var(--red); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar.small {
    width: 30px;
    height: 30px;
    font-size: 11px;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-agency {
    font-size: 11px;
    color: var(--gray-500);
}

/* ===== TOPBAR ===== */
#topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 90;
    transition: left var(--transition);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--gray-200);
    margin-left: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    transition: all var(--transition);
    position: relative;
}

.icon-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.notification-btn[data-count="0"]::after { display: none; }
.notification-btn[data-count]::after {
    content: attr(data-count);
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--red);
    color: var(--white);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification dropdown */
.notif-dropdown-wrap { position: relative; }
.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 999;
    overflow: hidden;
}
.notif-dropdown.hidden { display: none; }
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}
.notif-dropdown-header .btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.notif-dropdown-list {
    max-height: 400px;
    overflow-y: auto;
}
.notif-dd-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--gray-50);
}
.notif-dd-item:hover { background: var(--gray-50); }
.notif-dd-item.notif-unread { background: #eef2ff; }
.notif-dd-item.notif-unread:hover { background: #e0e7ff; }

/* Right panel notification items */
.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.notif-unread { background: #eef2ff; }
.notif-item.notif-unread:hover { background: #e0e7ff; }
.notif-icon-wrap {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--gray-50);
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.notif-message { font-size: 12px; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 11px; color: var(--gray-400); margin-top: 3px; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 6px 12px;
    min-width: 280px;
}

.search-bar .material-icons-outlined {
    font-size: 18px;
    color: var(--gray-400);
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    color: var(--gray-700);
    width: 100%;
    font-family: inherit;
}

.search-bar input::placeholder {
    color: var(--gray-400);
}

/* ===== MAIN CONTENT ===== */
#content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left var(--transition);
}

.page { display: none; }
.page.active { display: block; }

/* ===== STATS BAR ===== */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.stat-card.mini {
    padding: 12px 18px;
    gap: 8px;
}

.stat-card.mini .stat-number {
    font-size: 18px;
}

.stat-card.mini .material-icons-outlined {
    font-size: 20px;
    color: var(--gray-400);
}

.stat-icon {
    font-size: 28px;
    color: var(--blue);
    background: var(--blue-light);
    padding: 10px;
    border-radius: var(--radius);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ===== FILTERS BAR ===== */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 13px;
    color: var(--gray-700);
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

/* ===== LEGEND ===== */
.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ===== ACCUEIL LAYOUT ===== */
.accueil-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

/* ===== FEED ===== */
.feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.feed-card:hover {
    box-shadow: var(--shadow-md);
}

.feed-card-inner {
    display: flex;
    gap: 0;
}

.feed-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    min-width: 0;
}

.feed-date {
    text-align: center;
    flex-shrink: 0;
    min-width: 48px;
}

.feed-date .day {
    font-size: 22px;
    font-weight: 700;
    color: var(--blue);
    line-height: 1;
}

.feed-date .month {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: lowercase;
}

.feed-date .time {
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 2px;
}

.feed-agent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.feed-agent .user-avatar {
    width: 44px;
    height: 44px;
}

.feed-agent-name {
    font-size: 10px;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.2;
    max-width: 60px;
}

.feed-content {
    flex: 1;
    min-width: 0;
    padding: 16px 0 16px 0;
}

.feed-type-badge {
    display: inline-block;
    padding: 2px 0;
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
}

.feed-location {
    font-size: 13px;
    color: var(--gray-500);
}

.feed-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 4px 0;
}

.feed-details {
    background: var(--blue-50);
    border-left: 3px solid var(--blue);
    padding: 8px 12px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-top: 8px;
}

.feed-ref {
    font-size: 12px;
    color: var(--gray-600);
}

.feed-specs {
    font-size: 12px;
    color: var(--gray-500);
}

.feed-match {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--green);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

.feed-photos {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    width: 180px;
    position: relative;
    align-self: stretch;
}

.feed-photo {
    width: 100%;
    flex: 1;
    min-height: 120px;
    background: var(--gray-200);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-photo .material-icons-outlined {
    font-size: 36px;
    color: var(--gray-400);
}

.feed-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--white);
}

.feed-tag.new { background: var(--green); }
.feed-tag.updated { background: var(--blue); }
.feed-tag.removed { background: var(--red); }
.feed-tag.price-drop { background: var(--purple); }

.feed-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--gray-100);
}

.feed-comment {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.feed-comment input {
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    color: var(--gray-600);
    flex: 1;
    font-family: inherit;
}

.feed-comment input::placeholder {
    color: var(--gray-400);
}

/* ===== RIGHT PANEL ===== */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Widget Marché sur Accueil */
.accueil-marche-widget {
    transition: all 0.2s;
}
.accueil-marche-widget:hover {
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.12);
    border-color: rgba(67, 97, 238, 0.25);
    transform: translateY(-1px);
}
.marche-widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.marche-widget-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    background: var(--gray-100);
    border-radius: 10px;
    border: 1px solid transparent;
}
.marche-widget-stat.marche-widget-new {
    background: rgba(67, 97, 238, 0.08);
    border-color: rgba(67, 97, 238, 0.2);
}
.marche-widget-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.1;
}
.marche-widget-new .marche-widget-num {
    color: var(--blue, #4361EE);
}
.marche-widget-lbl {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
}
.marche-widget-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--gray-400);
    padding-top: 4px;
}

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

.notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item .notif-text {
    color: var(--gray-700);
    flex: 1;
}

.notif-item .notif-count {
    font-weight: 700;
    color: var(--blue);
    margin-left: 8px;
}

.notif-item .notif-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
}

.notif-item.warning { background: var(--orange-light); }
.notif-item.warning .notif-count { color: var(--orange); }
.notif-item.danger { background: var(--red-light); }
.notif-item.danger .notif-count { color: var(--red); }

/* ===== MINI CALENDAR ===== */
.mini-calendar {
    font-size: 12px;
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--gray-700);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.cal-day-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    padding: 4px 0;
    text-transform: uppercase;
}

.cal-day {
    padding: 6px 0;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-600);
    transition: all var(--transition);
}

.cal-day:hover {
    background: var(--blue-light);
}

.cal-day.today {
    background: var(--blue);
    color: var(--white);
    font-weight: 600;
}

.cal-day.other-month {
    color: var(--gray-300);
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.page-actions {
    display: flex;
    gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.btn .material-icons-outlined {
    font-size: 18px;
}

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

.btn-primary:hover {
    background: var(--blue-dark);
}

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

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn-outline {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover {
    background: rgba(67, 97, 238, 0.05);
}

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

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 7px 12px;
    min-width: 250px;
}

.search-inline .material-icons-outlined {
    font-size: 18px;
    color: var(--gray-400);
}

.search-inline input {
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    color: var(--gray-700);
    width: 100%;
    font-family: inherit;
}

.toolbar-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== DATA TABLE ===== */
.table-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--blue-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--blue);
}

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-active { background: var(--green-light); color: var(--green); }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }
.badge-prospect { background: var(--blue-light); color: var(--blue); }
.badge-warning { background: var(--orange-light); color: var(--orange); }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-compromis { background: var(--purple-light); color: var(--purple); }

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Product gallery in modal */
.produit-gallery { padding: 0; }
.produit-gallery.hidden { display: none; }
.gallery-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 420px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--gray-100);
}
.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: background 0.15s;
}
.gallery-arrow:hover { background: #fff; }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.gallery-thumbs {
    display: flex;
    gap: 6px;
    padding: 12px 0;
    overflow-x: auto;
}
.gallery-thumbs img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.gallery-thumbs img:hover { opacity: 0.75; }
.gallery-thumbs img.active { opacity: 1; border: 2px solid var(--primary); border-radius: 10px; }

.product-card-photo {
    height: 180px;
    background: var(--gray-200);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-photo .material-icons-outlined {
    font-size: 48px;
    color: var(--gray-400);
}

.product-card-photo .product-status {
    position: absolute;
    top: 10px;
    left: 10px;
}

.product-card-photo .product-price-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
}

.product-card-body {
    padding: 14px;
}

.product-card-type {
    font-size: 12px;
    color: var(--blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 4px 0;
}

.product-card-location {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-card-specs {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.product-spec {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.product-spec .material-icons-outlined {
    font-size: 16px;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid var(--gray-100);
    font-size: 11px;
    color: var(--gray-400);
}

/* Card photo carousel arrows */
.card-photo-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.card-photo-arrow .material-icons-outlined { font-size: 18px; color: var(--gray-700); }
.product-card-photo:hover .card-photo-arrow { opacity: 1; }
.card-arrow-left { left: 8px; }
.card-arrow-right { right: 8px; }
.card-photo-dots {
    position: absolute;
    bottom: 38px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 2;
}
.card-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: background 0.2s;
}
.card-dot.active { background: #fff; }

/* ===== TABS ===== */
.suivi-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    transition: all var(--transition);
}

.tab-btn:hover {
    color: var(--gray-700);
}

.tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
}

.empty-state h2 {
    color: var(--gray-700);
    margin: 16px 0 8px;
    font-size: 18px;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ===== LIBRARY ===== */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.library-folder {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    cursor: pointer;
    transition: all var(--transition);
}

.library-folder:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.folder-icon {
    font-size: 48px !important;
    color: var(--blue);
    display: block;
    margin-bottom: 8px;
}

.folder-name {
    font-weight: 600;
    color: var(--gray-800);
    display: block;
    font-size: 14px;
}

.folder-count {
    font-size: 12px;
    color: var(--gray-400);
}

/* ===== PORTALS ===== */
.portals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.portal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    position: relative;
    transition: all 0.15s;
}
.portal-card[onclick]:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue);
    transform: translateY(-2px);
}
.portal-config-icon {
    position: absolute;
    bottom: 14px;
    right: 14px;
    font-size: 18px;
    color: var(--gray-300);
    transition: color 0.15s;
}
.portal-card[onclick]:hover .portal-config-icon {
    color: var(--blue);
}

.portal-card.active-portal {
    border-left: 3px solid var(--green);
}

.portal-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    top: 20px;
    right: 20px;
}

.portal-status.online { background: var(--green); }
.portal-status.offline { background: var(--gray-300); }

.portal-card h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.portal-card p {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.portal-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--green-light);
    color: var(--green);
}

.portal-badge.inactive {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* ===== AGENCY ===== */
.agency-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.agency-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input {
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    color: var(--gray-700);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--gray-50);
}

.form-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
    background: #fff;
}

textarea.form-input {
    resize: vertical;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--gray-50);
}

.team-member strong {
    display: block;
    font-size: 13px;
    color: var(--gray-800);
}

.team-member .text-muted {
    font-size: 12px;
    color: var(--gray-500);
}

/* ===== TOOLS ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.tool-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    cursor: pointer;
    transition: all var(--transition);
}

.tool-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--blue);
}

.tool-card .material-icons-outlined {
    font-size: 36px;
    color: var(--blue);
    margin-bottom: 10px;
}

.tool-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.tool-card p {
    font-size: 12px;
    color: var(--gray-500);
}

/* ===== SETTINGS PAGE ===== */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}
.settings-nav {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 8px;
    position: sticky;
    top: 80px;
}
.settings-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
}
.settings-nav-btn .material-icons-outlined { font-size: 18px; }
.settings-nav-btn:hover { background: var(--gray-50); color: var(--gray-800); }
.settings-nav-btn.active { background: var(--blue-light); color: var(--blue); font-weight: 500; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.settings-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}
.settings-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}
.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-100);
}
.user-avatar.large {
    width: 56px;
    height: 56px;
    font-size: 18px;
}
.settings-user-name { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.settings-user-role { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.settings-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.settings-form-grid .full-width { grid-column: 1 / -1; }
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-50);
}
.settings-toggle-row:last-child { border-bottom: none; }
.settings-toggle-label { font-size: 13px; font-weight: 500; color: var(--gray-700); }
.settings-toggle-desc { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle-switch input { display: none; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gray-200);
    border-radius: 22px;
    cursor: pointer;
    transition: 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Team list */
.team-member-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-50);
}
.team-member-row:last-child { border-bottom: none; }
.team-member-info { flex: 1; min-width: 0; }
.team-member-name { font-size: 13px; font-weight: 500; color: var(--gray-800); }
.team-member-email { font-size: 12px; color: var(--gray-400); }
.team-member-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--blue-light);
    color: var(--blue);
}
.team-member-badge.directeur { background: var(--orange-light); color: var(--orange); }
.team-member-actions { display: flex; gap: 4px; }

.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-light); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

@media (max-width: 768px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 6px; }
    .settings-nav-btn { white-space: nowrap; padding: 8px 12px; font-size: 12px; }
    .settings-form-grid { grid-template-columns: 1fr; }
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal.modal-large {
    width: 720px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--gray-100);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-muted { color: var(--gray-500); }
.text-blue { color: var(--blue); }

/* ===== ACTIONS ===== */
.action-btns {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn .material-icons-outlined {
    font-size: 18px;
}

.action-btn.delete:hover {
    background: var(--red-light);
    color: var(--red);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .accueil-layout {
        grid-template-columns: 1fr;
    }
    .right-panel {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 768px) {
    #sidebar {
        width: var(--sidebar-collapsed);
    }
    #sidebar .nav-label,
    #sidebar .logo-text,
    #sidebar .user-info {
        display: none;
    }
    #sidebar .logo-full {
        width: 36px;
        object-fit: cover;
        object-position: left;
    }
    #sidebar .nav-item {
        justify-content: center;
        padding: 10px;
    }
    #topbar {
        left: var(--sidebar-collapsed);
    }
    #content {
        margin-left: var(--sidebar-collapsed);
        padding: 16px;
    }
    .agency-layout {
        grid-template-columns: 1fr;
    }
    .right-panel {
        grid-template-columns: 1fr;
    }
    .stats-bar {
        gap: 8px;
    }
    .stat-card {
        padding: 10px 14px;
        gap: 8px;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .form-grid.cols-3 {
        grid-template-columns: 1fr !important;
    }
    .doc-type-selector {
        grid-template-columns: 1fr;
        margin: 20px auto;
    }
    .doc-form {
        max-width: 100%;
    }
    .doc-form-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .search-bar {
        min-width: 0;
        flex: 1;
    }
    .topbar-user span:not(.user-avatar) {
        display: none;
    }
    table {
        font-size: 12px;
    }
    th, td {
        padding: 8px 6px !important;
    }
}

@media (max-width: 480px) {
    #sidebar {
        width: 0;
        overflow: hidden;
    }
    #sidebar.mobile-open {
        width: var(--sidebar-width);
        position: fixed;
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }
    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 199;
    }
    .mobile-overlay.active {
        display: block;
    }
    #sidebar.mobile-open .nav-label,
    #sidebar.mobile-open .logo-text,
    #sidebar.mobile-open .user-info {
        display: flex;
    }
    #sidebar.mobile-open .logo-full {
        width: 180px;
        object-fit: unset;
        object-position: unset;
    }
    #sidebar.mobile-open .nav-item {
        justify-content: flex-start;
        padding: 10px 12px;
    }
    #topbar {
        left: 0;
        padding: 0 10px;
    }
    #content {
        margin-left: 0;
        padding: 12px;
    }
    /* Topbar mobile */
    .search-bar {
        min-width: 0;
        flex: 1;
        padding: 4px 8px;
    }
    .search-bar input {
        font-size: 12px;
    }
    .topbar-right .icon-btn:not(.notification-btn) {
        display: none;
    }
    .topbar-user span:last-child {
        display: none;
    }
    /* Page header */
    .page-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-header h1 {
        font-size: 18px;
        width: 100%;
    }
    .page-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .page-actions .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    .page-actions .btn span.material-icons-outlined + span:not(.material-icons-outlined) {
        display: none;
    }
    /* Stats bar */
    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 10px 12px;
        gap: 8px;
    }
    .stat-number {
        font-size: 18px;
    }
    .stat-label {
        font-size: 10px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
    }
    .stat-icon .material-icons-outlined {
        font-size: 18px;
    }
    /* Feed cards */
    .feed-card-inner {
        flex-direction: column;
    }
    .feed-left {
        padding: 12px;
        gap: 8px;
    }
    .feed-date .day {
        font-size: 18px;
    }
    .feed-agent .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    .feed-agent-name {
        font-size: 9px;
    }
    .feed-photos {
        width: 100%;
        flex-direction: row;
        height: 120px;
    }
    .feed-photo {
        height: 100%;
    }
    .feed-content {
        padding: 0 12px 12px;
    }
    .feed-price {
        font-size: 15px;
    }
    /* Table responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 600px;
    }
    .data-table th,
    .data-table td {
        padding: 8px 8px;
        font-size: 12px;
    }
    /* Filters */
    .filters {
        flex-wrap: wrap;
        gap: 8px;
    }
    .filter-search {
        width: 100%;
    }
    /* Right panel */
    .right-panel {
        display: none;
    }
    /* Feed filter bar */
    .accueil-filters {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
    }
    .feed-legend {
        font-size: 11px;
        flex-wrap: wrap;
        gap: 6px;
    }
    /* Doc form */
    .doc-type-card {
        padding: 20px 16px;
    }
    .doc-step-header h4 {
        font-size: 14px;
    }
}

/* ===== MAP PAGE ===== */
#page-carte {
    padding-top: 0;
}

#page-carte .page-header {
    display: none;
}

.map-container {
    display: flex;
    position: relative;
    height: calc(100vh - var(--topbar-height) - 120px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--white);
}

#map {
    flex: 1;
    min-height: 500px;
    z-index: 1;
}

/* Map top bar */
.map-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.map-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 8px 14px;
    flex: 1;
    max-width: 400px;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
}

.map-search-wrapper:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

.map-search-wrapper .material-icons-outlined {
    font-size: 18px;
    color: var(--gray-400);
}

.map-search-wrapper input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-800);
    width: 100%;
}

.map-search-wrapper input::placeholder {
    color: var(--gray-400);
}

/* Search autocomplete dropdown */
.search-autocomplete {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.autocomplete-item:hover {
    background: var(--blue-50);
}

.autocomplete-item .material-icons-outlined {
    font-size: 18px;
    color: var(--gray-400);
    flex-shrink: 0;
}

.autocomplete-main {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
}

.autocomplete-sub {
    font-size: 11px;
    color: var(--gray-400);
}


.map-layer-toggles {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toggle-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-500);
    background: var(--white);
    transition: all var(--transition);
}

.toggle-pill input { display: none; }

.toggle-pill:has(input:checked) {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.toggle-pill.dvf-pill:has(input:checked) {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.toggle-pill.dpe-pill:has(input:checked) {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
}

.toggle-pill.collection-pill:has(input:checked) {
    background: #10B981;
    border-color: #10B981;
    color: #fff;
}

.toggle-pill:hover {
    border-color: var(--gray-300);
}

.map-count-pill {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-light);
    padding: 6px 14px;
    border-radius: 100px;
    white-space: nowrap;
}

.marche-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 5px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.map-sync-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s;
}
.map-sync-btn:hover:not(:disabled) {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue);
}
.map-sync-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.map-sync-btn.syncing .material-icons-outlined {
    animation: spin 1s linear infinite;
}
.map-sync-btn .material-icons-outlined {
    font-size: 18px;
}

/* Map filters bar */
.map-filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 0 0 12px;
    flex-wrap: wrap;
}

.map-filter-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    padding-left: 8px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.map-filter-wrapper:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.08);
}
.filter-icon {
    font-size: 15px;
    color: var(--gray-400);
    pointer-events: none;
    flex-shrink: 0;
}

.map-filter {
    padding: 7px 28px 7px 6px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    font-size: 12px;
    color: var(--gray-700);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    min-width: 80px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.map-filter:focus {
    border-color: transparent;
    box-shadow: none;
}

.map-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-filter-group label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-range {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-input {
    width: 90px;
    padding: 7px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 12px;
    color: var(--gray-700);
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.filter-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.08);
}

.filter-input::placeholder {
    color: var(--gray-400);
}

.filter-input::-webkit-inner-spin-button,
.filter-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-sep {
    color: var(--gray-400);
    font-size: 12px;
}

/* Map sidebar */
.map-sidebar {
    width: 380px;
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--transition);
}

.map-sidebar.collapsed {
    width: 0;
    border: none;
}

.map-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.map-sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.map-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.map-sidebar-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.map-sidebar-empty p {
    margin-top: 12px;
    font-size: 13px;
}

/* Back button */
.prop-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--blue);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: -4px;
}
.prop-back-btn:hover {
    text-decoration: underline;
}
.prop-back-btn .material-icons-outlined {
    font-size: 16px;
}

/* Property detail in sidebar */
.map-prop-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-prop-image {
    width: 100%;
    height: 220px;
    background: var(--gray-200);
    border-radius: var(--radius);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-prop-image .material-icons-outlined {
    font-size: 48px;
    color: var(--gray-400);
}

/* Galerie photos */
.map-prop-gallery {
    position: relative;
    width: 100%;
}
.map-prop-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-700);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 2;
}
.map-prop-gallery-arrow:hover {
    background: var(--white);
    color: var(--blue);
    transform: translateY(-50%) scale(1.1);
}
.map-prop-gallery-arrow.prev { left: 8px; }
.map-prop-gallery-arrow.next { right: 8px; }
.map-prop-gallery-arrow .material-icons-outlined { font-size: 22px; }
.map-prop-gallery-counter {
    position: absolute;
    bottom: 8px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

/* Strip de miniatures sous la photo principale */
.map-prop-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}
.map-prop-thumbs::-webkit-scrollbar { height: 4px; }
.map-prop-thumbs::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 4px; }
.map-prop-thumbs::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
.map-prop-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 45px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    opacity: 0.7;
}
.map-prop-thumb:hover {
    opacity: 1;
    transform: translateY(-1px);
}
.map-prop-thumb.active {
    opacity: 1;
    border-color: var(--blue);
    box-shadow: 0 2px 6px rgba(67, 97, 238, 0.3);
}

.map-prop-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.map-prop-address {
    font-size: 13px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-prop-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.map-prop-address .material-icons-outlined {
    font-size: 16px;
    color: var(--blue);
    flex-shrink: 0;
}

.map-prop-spec .material-icons-outlined {
    font-size: 20px;
    color: var(--blue);
    flex-shrink: 0;
}

.map-prop-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    background: var(--blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.map-prop-link:hover {
    background: var(--blue-dark);
}

.map-prop-link .material-icons-outlined {
    font-size: 16px;
}

/* Biens nearby section */
.biens-nearby-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.biens-nearby-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bien-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--blue);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow var(--transition);
}

.bien-card:hover {
    box-shadow: var(--shadow-sm);
}

.bien-card-img {
    width: 60px;
    height: 50px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.bien-card-body {
    flex: 1;
    min-width: 0;
}

.bien-card-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
}

.bien-card-details {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--gray-500);
}

.bien-card-titre {
    font-size: 11px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* DVF & Entreprises sections */
.dvf-section, .entreprises-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.dvf-section h4, .entreprises-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 4px;
}

/* DVF cards */
.dvf-card {
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--orange);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: box-shadow var(--transition);
}

.dvf-card:hover {
    box-shadow: var(--shadow-sm);
}

.dvf-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.dvf-card-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
}

.dvf-card-prixm2 {
    font-size: 11px;
    font-weight: 600;
    color: var(--orange);
    background: var(--orange-light);
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}

.dvf-card-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.dvf-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 3px 8px;
    border-radius: 4px;
}

.dvf-tag .material-icons-outlined {
    font-size: 13px;
    color: var(--gray-400);
}

.dvf-card-address {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.dvf-card-address .material-icons-outlined {
    font-size: 12px;
    color: var(--gray-400);
}

.dvf-card-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--gray-400);
}

.dvf-card-footer .material-icons-outlined {
    font-size: 13px;
}

/* Entreprise cards */
.ent-card {
    display: block;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--green);
    border-radius: var(--radius);
    margin-bottom: 8px;
    text-decoration: none;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.ent-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--green);
}

.ent-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.ent-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.3;
}

.ent-status {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ent-status.active {
    color: var(--green);
    background: var(--green-light);
}

.ent-status.closed {
    color: var(--red);
    background: var(--red-light);
}

.ent-card-activite {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 8px;
    line-height: 1.4;
}

.ent-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ent-card-siren {
    font-size: 11px;
    font-family: monospace;
    color: var(--gray-400);
}

.ent-card-date,
.ent-card-effectif {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--gray-400);
}

.ent-card-date .material-icons-outlined,
.ent-card-effectif .material-icons-outlined {
    font-size: 12px;
}

.ent-card-pappers {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
    opacity: 0;
    transition: opacity var(--transition);
}

.ent-card:hover .ent-card-pappers {
    opacity: 1;
}

.ent-card-pappers .material-icons-outlined {
    font-size: 13px;
}

/* Parcel detail styles */
.parcel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.parcel-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.parcel-icon-circle .material-icons-outlined {
    font-size: 22px;
    color: var(--blue);
}

.parcel-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.parcel-ref {
    font-size: 11px;
    color: var(--gray-400);
    font-family: monospace;
}

.parcel-address-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
}

.parcel-address-line .material-icons-outlined {
    font-size: 16px;
    color: var(--blue);
}

.parcel-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.parcel-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.parcel-info-item > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.parcel-info-icon {
    font-size: 18px;
    color: var(--blue);
    margin-top: 2px;
}

.parcel-info-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
}

.parcel-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

/* Property detail improvements */
.prop-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.prop-type-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-light);
    padding: 3px 10px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 4px;
}

.prop-price-m2 {
    font-size: 13px;
    color: var(--gray-500);
}

.prop-dpe-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius);
    white-space: nowrap;
    flex-shrink: 0;
}

.prop-titre {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
    line-height: 1.4;
}

.prop-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.prop-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-400);
}

.prop-meta .material-icons-outlined {
    font-size: 14px;
}

.prop-meta-new {
    display: inline-block;
    background: var(--blue, #4361EE);
    color: white;
    padding: 1px 7px;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

.map-prop-spec {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 8px 12px;
    border-radius: var(--radius);
}

.map-prop-spec > div {
    display: flex;
    flex-direction: column;
}

.spec-value {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.spec-label {
    font-size: 10px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mapbox popup */
.mapboxgl-popup-content {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-md) !important;
    padding: 0 !important;
    min-width: 200px;
}
.mapboxgl-popup-close-button {
    display: none;
}

/* DPE section in map sidebar */
.dpe-map-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}
.dpe-map-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dpe-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
}
.dpe-row:last-child {
    border-bottom: none;
}
.dpe-letter {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    background: var(--blue);
}
.dpe-row-body {
    min-width: 0;
    flex: 1;
}
.dpe-row-main {
    font-size: 12px;
    color: var(--gray-700);
}
.dpe-row-complement {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 1px;
}
.dpe-row-detail {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 1px;
}
.dpe-row-date {
    font-size: 10px;
    color: var(--gray-300);
    margin-top: 1px;
}

.map-popup {
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.map-popup .popup-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.map-popup .popup-address {
    color: var(--gray-500);
    font-size: 12px;
    margin: 2px 0;
}

.map-popup .popup-specs {
    color: var(--gray-600);
    font-size: 12px;
}

/* ===== PRODUIT FULLSCREEN MODAL ===== */
.modal.modal-fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
}
.modal.modal-fullscreen .modal-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    padding: 14px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.produit-tabs {
    display: flex;
    gap: 4px;
    border-bottom: none;
    padding: 8px 24px;
    background: #fff;
    flex-shrink: 0;
    overflow-x: auto;
}

.produit-tab {
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.produit-tab:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.produit-tab.active {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.produit-tab-content {
    display: none;
    padding: 28px 32px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.produit-tab-content.active {
    display: block;
}


/* Form sections */
.form-section {
    margin-bottom: 24px;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gray-100);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.form-section-title .material-icons-outlined {
    font-size: 18px;
    color: var(--blue);
}

/* 3-column grid */
.form-grid.cols-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

/* Input addon (euro, m2, %) */
.input-addon {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-addon .form-input {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}

.input-addon .form-input:focus {
    box-shadow: none;
}

.input-addon:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

.input-addon .addon {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 600;
    border-left: 1px solid var(--gray-200);
    white-space: nowrap;
}

/* Checkbox grids */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.checkbox-grid label:hover {
    background: var(--gray-50);
}

.checkbox-group {
    display: flex;
    gap: 12px;
    align-items: center;
    height: 38px;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
}

/* Pieces list (surfaces tab) */
.piece-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
}

.piece-row select,
.piece-row input {
    font-size: 13px;
}

.piece-row .btn-remove-piece {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.piece-row .btn-remove-piece:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* Proximites grid with distances */
.proxi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6px;
}

.proxi-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius);
    font-size: 13px;
}

.proxi-row:hover {
    background: var(--gray-50);
}

.proxi-row .proxi-icon {
    font-size: 18px;
    color: var(--gray-400);
    width: 22px;
    text-align: center;
}

.proxi-row input[type="checkbox"] {
    margin: 0;
}

.proxi-row .proxi-label {
    flex: 1;
    color: var(--gray-700);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proxi-row .proxi-distance {
    width: 60px;
}

.proxi-row .proxi-distance input {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
    text-align: right;
}

.proxi-row .proxi-unite {
    width: 60px;
}

.proxi-row .proxi-unite select {
    width: 100%;
    padding: 3px 4px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
}

/* Diagnostics list */
.diag-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-50);
    font-size: 13px;
}

.diag-row:last-child {
    border-bottom: none;
}

.diag-row .diag-name {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
}

.diag-row .diag-status {
    display: flex;
    gap: 12px;
    align-items: center;
}

.diag-row .diag-status label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--gray-600);
    cursor: pointer;
}

.diag-row .diag-dates {
    display: flex;
    gap: 8px;
    align-items: center;
}

.diag-row .diag-dates input {
    padding: 4px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
    width: 120px;
}

/* Photo upload */
.photo-upload-zone {
    min-height: 200px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.photo-thumb {
    position: relative;
    aspect-ratio: 4/5;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}
.photo-thumb img {
    flex: 1;
    min-height: 0;
}
.photo-thumb .photo-category-select {
    width: 100%;
    padding: 4px 6px;
    border: none;
    border-top: 1px solid var(--gray-200);
    background: white;
    font-size: 11px;
    color: var(--gray-700);
    cursor: pointer;
    border-radius: 0;
}
.photo-thumb .photo-category-select:focus {
    outline: none;
    background: var(--blue-light);
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb .photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-thumb:hover .photo-remove {
    opacity: 1;
}

.photo-add-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.photo-add-btn:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}

/* Portails grid (transferts tab) */
.portail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.portail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.portail-card:hover {
    border-color: var(--blue);
    box-shadow: 0 2px 8px rgba(67,97,238,0.1);
}

.portail-card:has(input:checked) {
    border-color: var(--blue);
    background: var(--blue-light);
}

.portail-card input[type="checkbox"] {
    position: absolute;
    top: 8px;
    left: 8px;
}

.portail-logo {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.portail-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Publier banner */
.publier-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--blue-light);
    border-radius: var(--radius);
    border: 1px solid rgba(67,97,238,0.15);
}

/* ===== DIFFUSION SELOGER (onglet produit) ===== */
.seloger-score-card {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
}
.seloger-score-gauge {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
}
.seloger-score-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: conic-gradient(var(--score-color, var(--blue)) calc(var(--score-pct, 0) * 1%), var(--gray-100) 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}
.seloger-score-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    background: white;
    border-radius: 50%;
}
.seloger-score-circle span {
    position: relative;
    font-size: 32px;
    font-weight: 700;
    color: var(--score-color, var(--blue));
}
.seloger-score-circle small {
    position: relative;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: -4px;
}
.seloger-score-info {
    flex: 1;
}
.seloger-score-level {
    font-size: 18px;
    font-weight: 700;
    color: var(--score-color, var(--blue));
    margin-bottom: 4px;
}
.seloger-score-help {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
}
.seloger-score-bar {
    height: 8px;
    background: var(--gray-100);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}
.seloger-score-fill {
    height: 100%;
    background: var(--score-color, var(--blue));
    border-radius: 100px;
    transition: width 0.5s ease;
}
.seloger-blockers {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius);
    font-size: 13px;
    color: #b91c1c;
}
.seloger-blockers strong {
    display: block;
    margin-bottom: 6px;
    color: #991b1b;
}

.seloger-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.seloger-check-group {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 14px;
}
.seloger-check-group h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.seloger-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--gray-700);
}
.seloger-check-item.ok { color: #059669; }
.seloger-check-item.ko { color: #6b7280; }
.seloger-check-item .material-icons-outlined {
    font-size: 16px;
    flex-shrink: 0;
}

.seloger-equipements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}
.seloger-eq {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    user-select: none;
}
.seloger-eq:hover {
    background: var(--blue-light);
}
.seloger-eq input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.seloger-publish-zone {
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}
.seloger-publish-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}
.seloger-publish-status.publie {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
.seloger-publish-status.inactif {
    background: var(--gray-200);
    color: var(--gray-500);
}
.seloger-publish-status.erreur {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.form-help {
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 400;
}

/* ===== SELOGER LISTINGS MODAL ===== */
.portal-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
}
.portal-action-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s;
}
.portal-action-btn:hover {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue);
}
.portal-action-btn .material-icons-outlined {
    font-size: 16px;
}

.seloger-env-badge {
    display: inline-flex;
    align-items: center;
}

.seloger-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.seloger-listing-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
}
.seloger-listing-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.sl-card-photo {
    width: 100%;
    height: 180px;
    background-color: var(--gray-100);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
}
.sl-card-photo .material-icons-outlined {
    font-size: 48px;
}
.sl-card-photos-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}
.sl-card-deleted {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc2626;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.sl-card-body {
    padding: 14px;
}
.sl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}
.sl-card-type {
    font-size: 10px;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sl-card-dpe {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}
.sl-card-dpe.dpe-a { background: #2B45C6; }
.sl-card-dpe.dpe-b { background: #4361EE; }
.sl-card-dpe.dpe-c { background: #6580F2; }
.sl-card-dpe.dpe-d { background: #879FF5; }
.sl-card-dpe.dpe-e { background: #A9BEF8; color: #2B45C6; }
.sl-card-dpe.dpe-f { background: #CBDDFB; color: #3A56D4; }
.sl-card-dpe.dpe-g { background: #E5EEFE; color: #4361EE; }
.sl-card-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.sl-card-headline {
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 36px;
}
.sl-card-specs {
    display: flex;
    gap: 12px;
    color: var(--gray-600);
    font-size: 13px;
    margin-bottom: 8px;
}
.sl-card-specs span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.sl-card-specs .material-icons-outlined {
    font-size: 15px;
    color: var(--gray-400);
}
.sl-card-location {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.sl-card-location .material-icons-outlined {
    font-size: 14px;
}
.sl-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray-400);
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
}

.seloger-detail-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-100);
}
.seloger-detail-tab {
    background: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
}
.seloger-detail-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    background: white;
}

.sl-preview-mock {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.sl-preview-photos {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2px;
    height: 280px;
}
.sl-preview-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sl-preview-photos img:first-child {
    grid-row: span 2;
}
.sl-preview-body {
    padding: 20px;
}
.sl-preview-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}
.sl-preview-headline {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
}
.sl-preview-specs {
    display: flex;
    gap: 16px;
    color: var(--gray-600);
    font-size: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 12px;
}
.sl-preview-location {
    color: var(--gray-700);
    font-size: 14px;
    margin-bottom: 12px;
}
.sl-preview-energy {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.sl-preview-energy span {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}
.sl-preview-energy span.dpe-a { background: #2B45C6; }
.sl-preview-energy span.dpe-b { background: #4361EE; }
.sl-preview-energy span.dpe-c { background: #6580F2; }
.sl-preview-energy span.dpe-d { background: #879FF5; }
.sl-preview-energy span.dpe-e { background: #A9BEF8; color: #2B45C6; }
.sl-preview-energy span.dpe-f { background: #CBDDFB; color: #3A56D4; }
.sl-preview-energy span.dpe-g { background: #E5EEFE; color: #4361EE; }
.sl-preview-desc {
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ===== DPE PAGE ===== */
.dpe-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.dpe-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dpe-page-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}
.dpe-subtitle {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 500;
    margin: 2px 0 0 0;
}

/* Barometer */
.dpe-barometer {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.dpe-baro-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.dpe-baro-item:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}
.dpe-baro-pill {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.2s;
}
.dpe-baro-item:hover .dpe-baro-pill {
    transform: scale(1.1);
}
.dpe-baro-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}
.dpe-baro-pill.dpe-a { background: #2B45C6; }
.dpe-baro-pill.dpe-b { background: #4361EE; }
.dpe-baro-pill.dpe-c { background: #6580F2; }
.dpe-baro-pill.dpe-d { background: #879FF5; }
.dpe-baro-pill.dpe-e { background: #A9BEF8; color: #2B45C6; }
.dpe-baro-pill.dpe-f { background: #CBDDFB; color: #3A56D4; }
.dpe-baro-pill.dpe-g { background: #E5EEFE; color: #4361EE; }

/* Filters bar */
.dpe-filters-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.dpe-filters-main {
    display: flex;
    gap: 12px;
    align-items: center;
}
.dpe-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}
.dpe-search-wrap > .material-icons-outlined {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    font-size: 20px;
    pointer-events: none;
}
.dpe-search-wrap input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 13px;
    background: var(--gray-100);
    color: var(--gray-700);
    transition: all 0.2s;
}
.dpe-search-wrap input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.dpe-filter-chip-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.dpe-filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-100);
    transition: all 0.2s;
    cursor: pointer;
}
.dpe-filter-chip:hover {
    border-color: rgba(67,97,238,0.3);
    background: var(--blue-light);
}
.dpe-filter-chip:focus-within {
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.dpe-filter-chip > .material-icons-outlined {
    font-size: 16px;
    color: var(--gray-400);
    flex-shrink: 0;
}
.dpe-filter-chip:focus-within > .material-icons-outlined {
    color: var(--blue);
}
.dpe-filter-chip select,
.dpe-filter-chip input {
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    padding: 2px 0;
    outline: none;
    min-width: 0;
    max-width: 160px;
}
.dpe-filter-chip input {
    width: 80px;
}
.dpe-filter-chip input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}
/* Numeric range filters */
.dpe-filters-numeric {
    display: flex;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}
.dpe-range-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dpe-range-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.dpe-range-label .material-icons-outlined {
    font-size: 14px;
    color: var(--gray-400);
}
.dpe-range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dpe-range-inputs input {
    flex: 1;
    padding: 7px 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    background: var(--gray-100);
    color: var(--gray-700);
    text-align: center;
    min-width: 0;
    transition: all 0.2s;
    -moz-appearance: textfield;
}
.dpe-range-inputs input::-webkit-outer-spin-button,
.dpe-range-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.dpe-range-inputs input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.dpe-range-inputs input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}
.dpe-range-sep {
    color: var(--gray-300);
    font-weight: 500;
    flex-shrink: 0;
}

.dpe-filters-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.dpe-active-filters {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
}
.dpe-active-filters:empty { display: none; }
.dpe-active-filters .dpe-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--blue-light);
    color: var(--blue);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}
.dpe-reset-btn {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: auto;
}
.dpe-reset-btn .material-icons-outlined {
    font-size: 14px;
}
.dpe-reset-btn:hover {
    background: var(--red-light, #fef2f2);
    border-color: var(--red, #ef4444);
    color: var(--red, #ef4444);
}
.dpe-reset-btn.visible {
    display: inline-flex;
}

/* Results */
.dpe-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}
.dpe-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--gray-400);
    font-size: 14px;
}
.dpe-card {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.dpe-card:hover {
    border-color: rgba(67,97,238,0.25);
    box-shadow: var(--shadow-sm);
}
.dpe-card-address {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dpe-card-address-main {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dpe-card-address-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-400);
}
.dpe-card-address-details span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dpe-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dpe-card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.dpe-card-metric-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dpe-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
}
.dpe-badge.dpe-a { background: #2B45C6; }
.dpe-badge.dpe-b { background: #4361EE; }
.dpe-badge.dpe-c { background: #6580F2; }
.dpe-badge.dpe-d { background: #879FF5; }
.dpe-badge.dpe-e { background: #A9BEF8; color: #2B45C6; }
.dpe-badge.dpe-f { background: #CBDDFB; color: #3A56D4; }
.dpe-badge.dpe-g { background: #E5EEFE; color: #4361EE; }
.dpe-badge.dpe-na {
    background: var(--gray-200);
    color: var(--gray-400);
}

.dpe-card-surface {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

.dpe-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dpe-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    color: var(--gray-400);
    flex-shrink: 0;
    transition: all 0.15s;
}
.dpe-copy-btn:hover {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue);
}

.dpe-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--gray-400);
    gap: 8px;
}
.dpe-empty .material-icons-outlined {
    font-size: 40px;
    color: var(--gray-300);
}

/* Pagination */
.dpe-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
    background: var(--blue-light);
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-dots {
    padding: 0 4px;
    color: var(--gray-400);
}
.page-info {
    margin-left: 12px;
    font-size: 13px;
    color: var(--gray-400);
}

/* DPE Responsive */
@media (max-width: 768px) {
    .dpe-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dpe-barometer {
        gap: 4px;
        padding: 12px 10px;
    }
    .dpe-baro-pill {
        width: 34px;
        height: 34px;
        font-size: 16px;
        border-radius: 8px;
    }
    .dpe-baro-count {
        font-size: 11px;
    }
    .dpe-baro-item {
        padding: 6px 2px;
    }
    .dpe-filters-main {
        flex-direction: column;
    }
    .dpe-search-wrap {
        min-width: 100%;
    }
    .dpe-filter-chip-group {
        width: 100%;
    }
    .dpe-filter-chip {
        flex: 1;
        min-width: calc(50% - 4px);
    }
    .dpe-filter-chip select {
        max-width: none;
        flex: 1;
    }
    .dpe-filters-numeric {
        flex-direction: column;
        gap: 12px;
    }
    .dpe-card {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 14px;
    }
    .dpe-card-badges {
        justify-content: flex-start;
    }
    .dpe-card-surface {
        text-align: left;
    }
}
@media (max-width: 480px) {
    .dpe-page-title h2 {
        font-size: 16px;
    }
    .dpe-barometer {
        flex-wrap: wrap;
        justify-content: center;
    }
    .dpe-baro-item {
        flex: 0 0 auto;
        min-width: 40px;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== DOCUMENTS PAGE ===== */
.doc-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 700px;
    margin: 40px auto;
}

.doc-type-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.doc-type-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.doc-type-card .material-icons {
    font-size: 48px;
    color: var(--blue);
    margin-bottom: 12px;
}
.doc-type-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}
.doc-type-card p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
}

.doc-form {
    max-width: 800px;
    margin: 0 auto;
}

.doc-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}
.doc-form-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
}

.doc-step {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.doc-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-700);
}

.doc-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.doc-step .form-grid {
    padding: 20px;
}

.doc-step .form-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Avenant modifications */
.avenant-modif {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.avenant-modif:last-child {
    border-bottom: none;
}

.avenant-modif-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 10px;
}

.avenant-radios {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
}
.avenant-radios label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
}
.avenant-radios input[type="radio"] {
    accent-color: var(--blue);
}

.avenant-detail {
    margin-top: 8px;
}

/* Doc form button row at bottom */
.doc-form > .form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ---- Map responsive ---- */
@media (max-width: 768px) {
    .map-topbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .map-search-wrapper {
        max-width: 100%;
        flex: 1 1 100%;
    }
    .map-filters-bar {
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .map-filters-bar::-webkit-scrollbar {
        height: 0;
    }
    .map-filter-wrapper,
    .map-filter-group {
        flex-shrink: 0;
    }
    .map-filter-group label {
        display: none;
    }
    .filter-input {
        width: 70px;
    }
    .map-container {
        height: calc(100vh - var(--topbar-height) - 150px);
        border-radius: var(--radius);
    }
    .map-sidebar {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 320px;
        z-index: 10;
        box-shadow: var(--shadow-lg);
    }
    .map-sidebar.collapsed {
        width: 0;
    }
    .map-count-pill {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .map-topbar {
        gap: 6px;
        padding: 6px 0;
    }
    .map-layer-toggles {
        gap: 4px;
    }
    .toggle-pill {
        font-size: 11px;
        padding: 4px 10px;
    }
    .map-filters-bar {
        gap: 6px;
        padding-bottom: 6px;
    }
    .map-filter-wrapper {
        padding-left: 6px;
    }
    .filter-icon {
        font-size: 13px;
    }
    .map-filter {
        font-size: 11px;
        padding: 6px 24px 6px 4px;
        min-width: 60px;
    }
    .filter-input {
        width: 55px;
        padding: 6px 6px;
        font-size: 11px;
    }
    .map-container {
        height: calc(100vh - var(--topbar-height) - 110px);
        border-radius: var(--radius-sm);
    }
    .map-sidebar {
        width: 100%;
    }
    .map-sidebar.collapsed {
        width: 0;
    }
    .map-sidebar-content {
        padding: 12px;
    }
}

/* ========== VITRINE PAGE ========== */

/* Search bar */
.vitrine-searchbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.vitrine-search-wrapper {
    flex: 1;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.vitrine-search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.vitrine-search-wrapper .material-icons-outlined {
    font-size: 20px;
    color: var(--gray-400);
}
.vitrine-search-wrapper input {
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 13px;
    outline: none;
    width: 100%;
    font-family: inherit;
}
.vitrine-autocomplete {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}
.vitrine-autocomplete.open { display: block; }
.vitrine-ac-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
}
.vitrine-ac-item:hover { background: var(--gray-50); }
.vitrine-ac-item .material-icons-outlined { font-size: 16px; color: var(--gray-400); }
.vitrine-ac-item:first-child { border-radius: 10px 10px 0 0; }
.vitrine-ac-item:last-child { border-radius: 0 0 10px 10px; }

.vitrine-count-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Filters bar */
.vitrine-filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 24px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    flex-shrink: 0;
}
.vitrine-filter-group {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.vitrine-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
}
.vitrine-filter {
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-family: inherit;
    color: var(--gray-700);
    cursor: pointer;
}
.vitrine-filter:focus {
    border-color: var(--primary);
    outline: none;
}
.vitrine-filter-range {
    display: flex;
    align-items: center;
    gap: 4px;
}
.vitrine-filter-input {
    width: 70px;
    padding: 6px 6px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    background: #fff;
}
.vitrine-filter-input:focus {
    border-color: var(--primary);
    outline: none;
}
.vitrine-sep { color: var(--gray-300); font-size: 11px; }
.vitrine-unit { font-size: 11px; color: var(--gray-400); font-weight: 500; }
.vitrine-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s;
    flex-shrink: 0;
}
.vitrine-reset-btn:hover { background: var(--gray-50); color: var(--primary); }
.vitrine-reset-btn .material-icons-outlined { font-size: 16px; }

/* Radius bar */
.vitrine-radius-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 24px;
    background: rgba(67,97,238,0.06);
    border-bottom: 1px solid rgba(67,97,238,0.15);
    font-size: 13px;
    flex-shrink: 0;
}
.vitrine-radius-bar strong {
    color: var(--gray-800);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vitrine-radius-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.vitrine-radius-slider input[type="range"] {
    width: 160px;
    accent-color: var(--primary);
    cursor: pointer;
}
#vitrine-radius-value {
    font-weight: 600;
    color: var(--primary);
    min-width: 45px;
}
.vitrine-radius-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: var(--gray-500);
}
.vitrine-radius-close:hover { background: rgba(0,0,0,0.06); }
.vitrine-radius-close .material-icons-outlined { font-size: 18px; }

/* Page layout */
#page-vitrine.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height) - 24px);
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    background: #fff;
}

/* Content container */
.vitrine-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.vitrine-listing {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--gray-50);
}
.vitrine-listing::-webkit-scrollbar { width: 6px; }
.vitrine-listing::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* Map panel */
.vitrine-map-wrap {
    width: 50%;
    min-width: 400px;
    position: relative;
    border-left: 1px solid var(--gray-200);
    transition: width 0.3s;
}
.vitrine-map-wrap.hidden { display: none; }
#vitrine-map { width: 100%; height: 100%; }
.vitrine-map-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}
.vitrine-map-close:hover { background: var(--gray-50); }
.vitrine-map-close .material-icons-outlined { font-size: 20px; }

/* Map toggle in pagination bar */
.vitrine-map-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}
.vitrine-map-toggle:hover { background: #3451d1; }
.vitrine-map-toggle .material-icons-outlined { font-size: 18px; }
.vitrine-map-toggle.active { background: var(--gray-700); }

/* Listing card */
.vitrine-card {
    display: flex;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    min-height: 130px;
    overflow: hidden;
}
.vitrine-listing.full-width .vitrine-card {
    min-height: 200px;
}
.vitrine-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.vitrine-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67,97,238,0.2), 0 4px 16px rgba(0,0,0,0.08);
}
.vitrine-card-photo {
    width: 220px;
    min-width: 220px;
    min-height: 130px;
    background: var(--gray-100);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* Wider photos when map is hidden (full-width listing) */
.vitrine-listing.full-width .vitrine-card-photo {
    width: 280px;
    min-width: 280px;
}
/* Multiple photos in card when full-width */
.vitrine-card-photos {
    display: none;
}
.vitrine-listing.full-width .vitrine-card-photos {
    display: flex;
    gap: 3px;
    width: 380px;
    min-width: 380px;
    min-height: 200px;
    overflow: hidden;
    border-radius: 14px 0 0 14px;
    flex-shrink: 0;
    align-self: stretch;
}
.vitrine-listing.full-width .vitrine-card-photos .vitrine-card-photo-item {
    flex: 1;
    background: var(--gray-100);
    background-size: cover;
    background-position: center;
    position: relative;
}
/* Photo principale à gauche : prend ~60% de la largeur */
.vitrine-listing.full-width .vitrine-card-photos > .vitrine-card-photo-item:first-child {
    flex: 1.6;
}
/* Stack vertical à droite (photo 2 et photo 3) */
.vitrine-listing.full-width .vitrine-card-photos-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.vitrine-listing.full-width .vitrine-card-photos-stack .vitrine-card-photo-item {
    flex: 1;
    min-height: 0;
}
.vitrine-listing.full-width .vitrine-card-photos + .vitrine-card-photo {
    display: none;
}
.vitrine-card-photo .material-icons-outlined {
    font-size: 36px;
    color: var(--gray-300);
}
.vitrine-card-body {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.vitrine-card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.vitrine-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.vitrine-card-pm2 {
    font-size: 12px;
    color: var(--gray-500);
}
.vitrine-card-titre {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.vitrine-card-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-top: 2px;
}
.vitrine-card-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}
.vitrine-card-address {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vitrine-card-address .material-icons-outlined {
    font-size: 14px;
    color: var(--gray-400);
    flex-shrink: 0;
}
.vitrine-card-specs {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.vitrine-card-spec {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
}
.vitrine-card-spec .material-icons-outlined {
    font-size: 16px;
    color: var(--gray-400);
}
.vitrine-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}
.vitrine-card-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--blue-light, #DBE4FF);
    background: var(--blue-light, #EEF2FF);
    color: var(--blue, #4361EE);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.15s;
    white-space: nowrap;
}
.vitrine-card-link-btn:hover {
    background: var(--blue, #4361EE);
    color: white;
    border-color: var(--blue, #4361EE);
}
.vitrine-card-link-btn .material-icons-outlined {
    font-size: 14px;
}
.vitrine-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.vitrine-card-agence {
    font-size: 10px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.vitrine-card-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--gray-400);
    font-weight: 500;
}
.vitrine-card-date .material-icons-outlined {
    font-size: 11px;
}
.vitrine-card-new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--blue, #4361EE);
    color: white;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.4);
    z-index: 1;
}
.vitrine-card-dpe {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    align-self: flex-start;
}
.vitrine-card-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.vitrine-card-link:hover { text-decoration: underline; }

/* Empty state */
.vitrine-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--gray-400);
    gap: 8px;
}
.vitrine-empty .material-icons-outlined { font-size: 48px; }

/* Pagination */
.vitrine-footer {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
    gap: 12px;
}
.vitrine-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.vitrine-page-btn {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0 6px;
}
.vitrine-page-btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.vitrine-page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.vitrine-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.vitrine-page-btn .material-icons-outlined { font-size: 18px; }
.vitrine-page-info {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0 8px;
}

/* Vitrine detail popup */
.vitrine-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}
.vitrine-detail-popup {
    background: #fff;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: vitrinePopIn 0.25s ease;
}
.vitrine-detail-popup::-webkit-scrollbar { width: 5px; }
.vitrine-detail-popup::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
@keyframes vitrinePopIn {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.vitrine-detail-photo {
    width: 100%;
    height: 340px;
    background: var(--gray-100);
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.vitrine-detail-photo .material-icons-outlined {
    font-size: 64px;
    color: var(--gray-300);
}
/* Carousel */
.vitrine-carousel {
    position: absolute;
    inset: 0;
    display: flex;
    transition: transform 0.35s ease;
}
.vitrine-carousel img {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}
.vitrine-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 5;
    transition: transform 0.15s;
}
.vitrine-carousel-btn:hover { transform: translateY(-50%) scale(1.1); }
.vitrine-carousel-btn .material-icons-outlined { font-size: 20px; color: var(--gray-700); }
.vitrine-carousel-prev { left: 12px; }
.vitrine-carousel-next { right: 12px; }
.vitrine-carousel-dots {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}
.vitrine-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}
.vitrine-carousel-dot.active {
    background: #fff;
    transform: scale(1.3);
}
.vitrine-carousel-counter {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    z-index: 5;
}
.vitrine-detail-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    border-radius: 0 0 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.vitrine-detail-photo-price {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.vitrine-detail-photo-prixm2 {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}
.vitrine-detail-photo-dpe {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.vitrine-detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.92);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: transform 0.15s;
}
.vitrine-detail-close:hover { transform: scale(1.05); }
.vitrine-detail-close .material-icons-outlined { font-size: 20px; color: var(--gray-700); }
.vitrine-detail-body {
    padding: 20px 24px 24px;
}
.vitrine-detail-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(67,97,238,0.08);
    color: var(--primary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.vitrine-detail-type-badge .material-icons-outlined { font-size: 14px; }
.vitrine-detail-address {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 16px;
}
.vitrine-detail-address .material-icons-outlined { font-size: 18px; color: var(--primary); }
.vitrine-detail-specs {
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0 0 16px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.vitrine-detail-spec {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    border-right: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.vitrine-detail-spec:last-child { border-right: none; }
.vitrine-detail-spec .material-icons-outlined { font-size: 22px; color: var(--primary); }
.vitrine-detail-spec-value { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.vitrine-detail-spec-label { font-size: 10px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.3px; }
.vitrine-detail-titre {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
}
.vitrine-detail-description {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-line;
}
.vitrine-detail-description::-webkit-scrollbar { width: 4px; }
.vitrine-detail-description::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }
.vitrine-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--gray-100);
}
.vitrine-detail-agence {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
}
.vitrine-detail-agence .material-icons-outlined { font-size: 16px; color: var(--gray-400); }
.vitrine-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.vitrine-detail-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(67,97,238,0.25);
}
.vitrine-detail-link:hover { background: #3451d1; transform: translateY(-1px); }
.vitrine-detail-link .material-icons-outlined { font-size: 18px; }
.vitrine-detail-link-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.vitrine-detail-link-secondary:hover { background: rgba(67,97,238,0.05); }
.vitrine-detail-link-secondary .material-icons-outlined { font-size: 16px; }

/* Responsive */
@media (max-width: 1100px) {
    .vitrine-map-wrap { width: 45%; min-width: 320px; }
}
@media (max-width: 768px) {
    .vitrine-searchbar { padding: 10px 14px; }
    .vitrine-filters-bar { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
    .vitrine-listing { padding: 12px; }
    .vitrine-map-wrap { display: none !important; }
    .vitrine-card-photo { width: 140px; min-width: 140px; min-height: 120px; }
    .vitrine-listing.full-width .vitrine-card-photos { width: 220px; min-width: 220px; min-height: 140px; }
    .vitrine-listing.full-width .vitrine-card { min-height: 140px; }
    .vitrine-card-specs { flex-wrap: wrap; gap: 6px; }
    .vitrine-card-price { font-size: 15px; }
    .vitrine-card-address { font-size: 11px; }
    .vitrine-radius-bar { flex-wrap: wrap; padding: 8px 14px; }
    .vitrine-radius-slider { margin-left: 0; }
    .vitrine-detail-overlay { padding: 12px; }
    .vitrine-detail-popup { max-width: 100%; }
    .vitrine-detail-photo { height: 220px; }
    .vitrine-detail-specs { flex-wrap: wrap; }
    .vitrine-detail-spec { min-width: 45%; }
    .vitrine-detail-actions { flex-direction: column; }
    .vitrine-footer { flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 12px; }
    .vitrine-page-info { white-space: nowrap; font-size: 11px; }
}
@media (max-width: 480px) {
    .vitrine-card { flex-direction: column; min-height: auto; overflow: visible; }
    .vitrine-card-photo { width: 100%; min-width: 100%; min-height: 180px; border-radius: 14px 14px 0 0; }
    .vitrine-listing.full-width .vitrine-card-photos { width: 100%; min-width: 100%; min-height: 180px; border-radius: 14px 14px 0 0; }
    .vitrine-card-body { padding: 10px 14px; }
    .vitrine-card-specs { flex-wrap: wrap; }
}

/* ===== AGENDA PAGE ===== */
#page-agenda.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height) - 24px);
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    background: #fff;
}

/* Header */
.agenda-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    gap: 16px;
    flex-wrap: wrap;
}
.agenda-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.agenda-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    white-space: nowrap;
}
.agenda-title .material-icons-outlined { font-size: 24px; color: var(--blue); }
.agenda-view-tabs {
    display: flex;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}
.agenda-tab {
    padding: 6px 16px;
    border: none;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s;
}
.agenda-tab.active {
    background: var(--blue);
    color: #fff;
}
.agenda-tab:hover:not(.active) { background: var(--gray-50); }

.agenda-header-center {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.agenda-nav-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.agenda-nav-btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.agenda-nav-btn .material-icons-outlined { font-size: 20px; color: var(--gray-600); }
.agenda-current-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    min-width: 180px;
    text-align: center;
}
.agenda-today-btn {
    padding: 6px 14px;
    border: 1px solid var(--blue);
    border-radius: 10px;
    background: #fff;
    color: var(--blue);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.agenda-today-btn:hover { background: rgba(67,97,238,0.06); }

.agenda-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.agenda-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.agenda-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.agenda-filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-700);
    background: #fff;
    max-width: 160px;
}
.agenda-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.agenda-add-btn:hover { background: var(--blue-dark); }
.agenda-add-btn .material-icons-outlined { font-size: 18px; }

/* Calendar body */
.agenda-body {
    flex: 1;
    overflow: auto;
    position: relative;
}

/* Week view */
.agenda-week {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    min-height: 100%;
}
.agenda-week-header {
    display: contents;
}
.agenda-week-header-cell {
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--gray-200);
    border-left: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
}
.agenda-week-header-cell.today {
    color: var(--blue);
}
.agenda-week-header-cell .day-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}
.agenda-week-header-cell.today .day-num {
    color: #fff;
    background: var(--blue);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.agenda-time-col {
    border-bottom: 1px solid var(--gray-100);
    border-left: 1px solid var(--gray-100);
}
.agenda-time-gutter {
    position: relative;
    border-bottom: 1px solid var(--gray-100);
}
.agenda-time-gutter-label {
    position: absolute;
    top: -8px;
    right: 8px;
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
}
.agenda-time-col {
    position: relative;
    border-left: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    min-height: 48px;
    cursor: pointer;
}
.agenda-time-col:hover { background: rgba(67,97,238,0.02); }
.agenda-time-col::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 1px dashed var(--gray-100);
}

/* Day view */
.agenda-day-view {
    min-height: 100%;
}
.agenda-day-header {
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: capitalize;
    border-bottom: 2px solid var(--gray-200);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}
.agenda-day-header.today { color: var(--blue); }
.agenda-day-header .day-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 4px;
}
.agenda-day-header.today .day-num {
    color: #fff;
    background: var(--blue);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.agenda-day-row {
    display: grid;
    grid-template-columns: 60px 1fr;
}
.agenda-day-col {
    min-height: 60px;
}

/* Events */
.agenda-event {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    cursor: pointer;
    z-index: 3;
    line-height: 1.3;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.1s, box-shadow 0.1s;
}
.agenda-event:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 10;
}
.agenda-event-time {
    font-size: 10px;
    opacity: 0.85;
    font-weight: 500;
}
.agenda-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agenda-event-resize {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.15));
}
.agenda-event-resize:hover {
    background: linear-gradient(transparent, rgba(0,0,0,0.3));
}

/* Contact mini-form in RDV */
.rdv-contact-miniform {
    padding: 12px;
}
.rdv-contact-miniform-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
}
.rdv-contact-miniform-title .material-icons-outlined { font-size: 18px; color: var(--blue); }
.rdv-contact-miniform-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.rdv-contact-miniform-row input,
.rdv-contact-miniform-row select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.rdv-contact-miniform-row select { flex: 0 0 70px; }
.rdv-contact-miniform-row input:focus,
.rdv-contact-miniform-row select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.rdv-contact-miniform-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}
.rdv-contact-miniform-actions button {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.rdv-contact-miniform-actions button.primary {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* Month view */
.agenda-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
}
.agenda-month-header {
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--gray-200);
    border-left: 1px solid var(--gray-100);
    background: #fff;
}
.agenda-month-cell {
    min-height: 100px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--gray-100);
    border-left: 1px solid var(--gray-100);
    cursor: pointer;
    vertical-align: top;
}
.agenda-month-cell:hover { background: var(--gray-50); }
.agenda-month-cell.outside { background: var(--gray-50); opacity: 0.5; }
.agenda-month-cell.today { background: rgba(67,97,238,0.04); }
.agenda-month-day {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}
.agenda-month-cell.today .agenda-month-day {
    color: #fff;
    background: var(--blue);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.agenda-month-event {
    display: block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.agenda-month-more {
    font-size: 11px;
    color: var(--blue);
    font-weight: 600;
    cursor: pointer;
    padding: 0 6px;
}

/* RDV Form overlay */
.agenda-form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}
.agenda-form {
    background: #fff;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: vitrinePopIn 0.25s ease;
}
.agenda-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-100);
}
.agenda-form-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agenda-form-header h3 .material-icons-outlined { color: var(--blue); }
.agenda-form-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agenda-form-close:hover { background: var(--gray-100); }
.agenda-form-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.agenda-form-row {
    display: flex;
    gap: 12px;
}
.agenda-form-row > * { flex: 1; }
.agenda-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.agenda-form-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.agenda-form-field input,
.agenda-form-field select,
.agenda-form-field textarea {
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    transition: border-color 0.15s;
}
.agenda-form-field input:focus,
.agenda-form-field select:focus,
.agenda-form-field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.agenda-form-field textarea { resize: vertical; min-height: 60px; }
.agenda-form-colors {
    display: flex;
    gap: 8px;
}
.agenda-form-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.agenda-form-color:hover { transform: scale(1.15); }
.agenda-form-color.active { border-color: var(--gray-800); transform: scale(1.15); }
.agenda-form-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--gray-100);
}
.agenda-form-save {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.agenda-form-save:hover { background: var(--blue-dark); }
.agenda-form-cancel {
    padding: 12px 20px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #fff;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.agenda-form-cancel:hover { background: var(--gray-50); }
.agenda-form-delete {
    padding: 12px 16px;
    border: 1px solid var(--red);
    border-radius: 12px;
    background: #fff;
    color: var(--red);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.agenda-form-delete:hover { background: var(--red-light); }
.agenda-form-delete .material-icons-outlined { font-size: 16px; }

/* RDV Custom Pickers (Bien + Contact) */
.rdv-picker {
    position: relative;
}
.rdv-picker-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    min-height: 44px;
    font-size: 13px;
    color: var(--gray-700);
    transition: border-color 0.15s;
    background: #fff;
}
.rdv-picker-selected:hover { border-color: var(--gray-300); }
.rdv-picker-label { font-weight: 600; white-space: nowrap; }
.rdv-picker-meta { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdv-picker-clear {
    margin-left: auto;
    width: 22px; height: 22px;
    border: none; border-radius: 6px; background: var(--gray-100);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rdv-picker-clear .material-icons-outlined { font-size: 14px; color: var(--gray-500); }
.rdv-picker-clear:hover { background: var(--gray-200); }

.rdv-picker-dropdown {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 50;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
#rdv-contact-dropdown {
    top: auto;
    bottom: calc(100% + 4px);
}
.rdv-picker-dropdown.hidden { display: none; }
.rdv-picker-search {
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    color: var(--gray-800);
}
.rdv-picker-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.rdv-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.rdv-picker-item:hover { background: var(--gray-50); }
.rdv-picker-item-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(67,97,238,0.08);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rdv-picker-item-icon .material-icons-outlined { font-size: 18px; color: var(--blue); }
.rdv-picker-item-thumb {
    width: 36px; height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.rdv-picker-selected-thumb {
    width: 28px; height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.rdv-picker-item-info { min-width: 0; flex: 1; }
.rdv-picker-item-title { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdv-picker-item-sub { font-size: 11px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rdv-picker-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.rdv-picker-avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(67,97,238,0.1);
    color: var(--blue);
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.rdv-picker-create {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--gray-100);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    transition: background 0.1s;
}
.rdv-picker-create:hover { background: rgba(67,97,238,0.04); }
.rdv-picker-create .material-icons-outlined { font-size: 18px; }

.agenda-conflict-warning {
    padding: 10px 14px;
    background: var(--orange-light);
    border: 1px solid var(--orange);
    border-radius: 10px;
    color: var(--gray-700);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agenda-conflict-warning .material-icons-outlined { color: var(--orange); font-size: 20px; }

@media (max-width: 1100px) {
    .agenda-header { flex-wrap: wrap; }
    .agenda-header-center { margin-left: 0; }
}
@media (max-width: 768px) {
    .agenda-header { padding: 12px 14px; gap: 8px; }
    .agenda-header-left { flex-wrap: wrap; gap: 8px; }
    .agenda-title { font-size: 18px; }
    .agenda-header-center { margin-left: 0; gap: 6px; flex-wrap: wrap; }
    .agenda-current-label { font-size: 14px; }
    .agenda-today-btn { white-space: nowrap; }
    .agenda-header-right { flex-wrap: wrap; gap: 8px; }
    .agenda-filter-group { display: none; }
    .agenda-tab[data-view="week"] { display: none; }
    .agenda-today-btn { font-size: 12px; padding: 6px 12px; }
    .agenda-month-cell { min-height: 50px; padding: 2px 3px; font-size: 12px; }
    .agenda-month-header { padding: 6px 2px; font-size: 10px; letter-spacing: 0; }
    .agenda-month-event { font-size: 8px; padding: 1px 3px; }
    .agenda-month-day { font-size: 12px; }
    .agenda-form { max-width: 100%; border-radius: 16px; }
    .agenda-form-body { padding: 16px; }
    .agenda-form-row { flex-direction: column; gap: 10px; }
}
