/* ═══════════════════════════════════════════════════
   PROPTECH — Professional Real Estate Theme
   Clean. Blue/White. Trustworthy. Modern.
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ═══ RESET ═══ */

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

html {
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    color: var(--t1);
    background: var(--bg-void);
    line-height: 1.5;
    overflow-x: hidden;
}

::selection { background: var(--primary); color: #fff; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-bright); }

/* ═══ SCROLLBAR ═══ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ═══ TOP BAR ═══ */

.topbar {
    background: var(--bg-topbar);
    border-bottom: none;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 var(--sp-6);
    gap: var(--sp-6);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.topbar .brand {
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 16px;
    color: #FFFFFF;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    white-space: nowrap;
}

.topbar .brand i { font-size: 18px; color: #6CB4EE; }

.topbar .brand .brand-sub {
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-left: var(--sp-2);
}

/* Command search */
.topbar .cmd-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.topbar .cmd-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 7px 12px 7px 32px;
    border-radius: var(--r-2);
    outline: none;
    transition: all var(--fast);
}
.topbar .cmd-search input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(108, 180, 238, 0.15);
}
.topbar .cmd-search input::placeholder { color: rgba(255, 255, 255, 0.4); }

.topbar .cmd-search::before {
    content: '\F52A';
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    pointer-events: none;
}

/* Right cluster */
.topbar .top-right {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    margin-left: auto;
    font-family: var(--font-ui);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.topbar .plan-tag {
    background: #6CB4EE;
    color: #1B2A4A;
    font-weight: 700;
    font-size: 14px;
    padding: 2px 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: var(--r-1);
}

.topbar .user-name { color: #fff; font-weight: 500; }

.topbar .clock {
    color: rgba(255, 255, 255, 0.4);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

.topbar .btn-icon {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--fast);
    font-size: 13px;
    border-radius: var(--r-1);
}
.topbar .btn-icon:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* ═══ TAB BAR ═══ */

.tab-bar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--edge);
    display: flex;
    gap: 0;
    padding: 0 var(--sp-6);
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: var(--shadow-sm);
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-bar .tab-item {
    padding: 10px 18px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--t3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--fast);
    user-select: none;
}
.tab-bar .tab-item:hover {
    color: var(--t2);
    background: var(--primary-ghost);
}
.tab-bar .tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.tab-bar .tab-item i {
    margin-right: 5px;
    font-size: 13px;
}

/* ═══ MAIN LAYOUT ═══ */

.main-content {
    padding: var(--sp-5);
    min-height: calc(100vh - 90px - 30px);
}

/* ═══ PANELS ═══ */

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--edge);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s ease;
    overflow: visible;
}
.panel:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.05);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--edge);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-panel) 100%);
    min-height: 40px;
}

.panel-title {
    font-family: var(--font-term);
    font-size: 13px;
    font-weight: 800;
    color: var(--t1);
    letter-spacing: 0.5px;
}

.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }

/* Panel corner label */
.panel::after {
    content: attr(data-label);
    position: absolute;
    top: 0;
    right: 0;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-ghost);
    padding: 3px 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-radius: 0 12px 0 8px;
    border-left: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
}

/* ═══ KPI STRIP ═══ */

.kpi-strip {
    display: flex;
    gap: var(--sp-3);
    overflow-x: auto;
    scrollbar-width: none;
}
.kpi-strip::-webkit-scrollbar { display: none; }

.kpi-cell {
    background: var(--bg-panel);
    border: 1px solid var(--edge);
    border-radius: var(--r-2);
    padding: var(--sp-4) var(--sp-5);
    min-width: 160px;
    flex: 1;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.kpi-cell .kpi-label {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.kpi-cell .kpi-value {
    font-family: var(--font-data);
    font-size: 22px;
    font-weight: 700;
    color: var(--t1);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.kpi-cell .kpi-delta {
    font-family: var(--font-data);
    font-size: 13px;
    font-weight: 500;
    margin-top: 2px;
}
.kpi-cell .kpi-delta.up { color: var(--up); }
.kpi-cell .kpi-delta.up::before { content: '\25B2 '; font-size: 13px; }
.kpi-cell .kpi-delta.down { color: var(--down); }
.kpi-cell .kpi-delta.down::before { content: '\25BC '; font-size: 13px; }
.kpi-cell .kpi-delta.flat { color: var(--t3); }

.kpi-cell .kpi-sub {
    font-size: 14px;
    color: var(--t3);
}

.kpi-cell .kpi-spark {
    position: absolute;
    right: var(--sp-5);
    bottom: var(--sp-4);
    width: 50px;
    height: 18px;
    opacity: 0.3;
}

/* ═══ CADRANS (Pappers-style gauges) ═══ */

.cadran-panel {
    text-align: center;
    transition: transform var(--fast), box-shadow var(--fast);
}
.cadran-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.cadran-value {
    font-family: var(--font-data);
    font-size: 22px;
    font-weight: 700;
    color: var(--t1);
    margin-top: 4px;
    line-height: 1;
}
.cadran-label {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--t2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}
.cadran-sub {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--t3);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .cadrans-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═══ CATEGORY FILTER BAR ═══ */

.cat-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border: 1px solid var(--edge); border-radius: 2px;
    background: transparent; color: var(--t3);
    font-family: var(--font-term); font-size: 13px; font-weight: 600;
    text-transform: uppercase; cursor: pointer; transition: all var(--fast);
    letter-spacing: 0.5px;
}
.cat-btn:hover { border-color: var(--t3); color: var(--t1); }
.cat-btn.active { border-color: var(--amber); color: var(--amber); background: rgba(255,140,0,0.08); }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cat-count {
    font-size: 14px; padding: 1px 4px; border-radius: 2px;
    background: var(--bg-hover); color: var(--t3); margin-left: 2px;
}
.cat-btn.active .cat-count { background: rgba(255,140,0,0.15); color: var(--amber); }

.cat-badge {
    display: inline-block; padding: 1px 5px; border-radius: 2px;
    font-family: var(--font-term); font-size: 14px; font-weight: 700;
    letter-spacing: 0.3px; text-transform: uppercase;
}
.cat-badge-portfolio { background: rgba(30,86,160,0.15); color: #5B9CF6; }
.cat-badge-dvf { background: rgba(0,200,83,0.12); color: #00C853; }
.cat-badge-passoire { background: rgba(235,105,9,0.15); color: #EB6909; }
.cat-badge-offmarket { background: rgba(124,58,237,0.15); color: #7C3AED; }

/* ═══ OFF-MARKET CHIPS ═══ */
.om-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 14px; border: 1px solid var(--edge); border-radius: 20px;
    background: transparent; color: var(--t3);
    font-family: var(--font-term); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.om-chip:hover { border-color: var(--chip-color, var(--t3)); color: var(--chip-color, var(--t1)); background: rgba(255,255,255,0.03); }
.om-chip.active { border-color: var(--chip-color, var(--amber)); color: #fff; background: var(--chip-color, var(--amber)); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.om-chip-count {
    font-size: 13px; padding: 1px 6px; border-radius: 10px;
    background: rgba(255,255,255,0.1); margin-left: 2px;
}
.om-chip.active .om-chip-count { background: rgba(255,255,255,0.25); }

/* ═══ TIME SELECTOR ═══ */

.time-bar { display: flex; gap: 3px; align-items: center; }

.time-bar .t-btn {
    font-family: var(--font-term);
    font-size: 13px;
    font-weight: 700;
    color: var(--t3);
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px;
    letter-spacing: 0.3px;
}
.time-bar .t-btn:hover {
    background: var(--bg-hover);
    color: var(--t1);
    border-color: var(--edge);
}
.time-bar .t-btn.active {
    color: #fff;
    background: var(--primary);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* ═══ TABLES ═══ */

.tbl {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: 14px;
}

.tbl thead th {
    background: var(--bg-input);
    color: var(--t2);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
    position: sticky;
    top: 0;
    text-align: left;
}

.tbl tbody tr {
    border-bottom: 1px solid var(--edge-light);
    transition: background var(--fast);
}
.tbl tbody tr:hover { background: var(--primary-ghost); }

.tbl tbody td {
    padding: 6px 12px;
    line-height: 28px;
    font-variant-numeric: tabular-nums;
}

.tbl .num { text-align: right; }
.tbl .up { color: var(--up); }
.tbl .down { color: var(--down); }
.tbl .dim { color: var(--t3); }

/* ═══ BUTTONS ═══ */

.btn-amber {
    background: var(--primary);
    color: #fff;
    border: none;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: var(--r-1);
    transition: all var(--fast);
}
.btn-amber:hover { background: var(--primary-bright); }

.btn-ghost {
    background: transparent;
    color: var(--t2);
    border: 1px solid var(--edge);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: var(--r-1);
    transition: all var(--fast);
}
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-ghost.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-ghost);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--t3);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 15px;
    transition: color var(--fast), background var(--fast);
    border-radius: 4px;
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { color: var(--primary); background: var(--primary-ghost); }

/* ═══ FORMS ═══ */

.input-term {
    background: var(--bg-input);
    border: 1px solid var(--edge);
    color: var(--t1);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
    width: 100%;
    border-radius: var(--r-1);
    transition: border-color var(--fast);
}
.input-term:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-term::placeholder { color: var(--t3); }

.label-term {
    display: block;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--t2);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

select.input-term {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238E9DB2' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 14px;
    padding-right: 30px;
}

/* ═══ BADGES ═══ */

.tag {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    letter-spacing: 0.3px;
    border-radius: var(--r-1);
}
.tag-active  { background: var(--up-muted); color: var(--up); }
.tag-sold    { background: var(--down-muted); color: var(--down); }
.tag-pending { background: var(--info-muted); color: var(--info); }
.tag-trial   { background: var(--primary-muted); color: var(--primary); }

/* DPE */
.dpe-badge { font-family: var(--font-data); font-weight: 700; padding: 2px 7px; font-size: 14px; border-radius: 3px; }
.dpe { font-family: var(--font-data); font-weight: 700; padding: 2px 7px; font-size: 14px; border-radius: 3px; }
.dpe-A { background: #009C41; color: #fff; }
.dpe-B { background: #50B832; color: #fff; }
.dpe-C { background: #C8D200; color: #000; }
.dpe-D { background: #FFED00; color: #000; }
.dpe-E { background: #FBBA00; color: #000; }
.dpe-F { background: #EB6909; color: #fff; }
.dpe-G { background: #E2001A; color: #fff; }

/* ═══ STATUS BAR ═══ */

.statusbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #FFFFFF;
    border-top: 1px solid var(--edge);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-6);
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--t3);
    z-index: 100;
    gap: var(--sp-8);
}

.statusbar .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: pulse-dot 2s ease-in-out infinite;
}
.statusbar .status-dot.live { background: var(--up); }

@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.statusbar .ticker {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    color: var(--t3);
}

.statusbar .ticker-inner {
    display: inline-block;
    animation: scroll-ticker 40s linear infinite;
}

@keyframes scroll-ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.statusbar .ticker .up { color: var(--up); }
.statusbar .ticker .down { color: var(--down); }

.statusbar .status-right {
    display: flex;
    gap: var(--sp-6);
    align-items: center;
    color: var(--t3);
}

.statusbar .status-right .amber { color: var(--primary); }

/* ═══ GRID HELPERS ═══ */

.g-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.g-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.g-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: var(--sp-4); }
.g-1-3 { display: grid; grid-template-columns: 1fr 3fr; gap: var(--sp-4); }

@media (max-width: 900px) {
    .g-2, .g-3, .g-4, .g-3-1, .g-1-3 { grid-template-columns: 1fr; }
    .kpi-strip { flex-wrap: wrap; }
    .kpi-cell { min-width: calc(50% - 4px); }
}

/* ═══ TOAST ═══ */

.toast-bb {
    background: #fff;
    border: 1px solid var(--edge);
    border-left: 3px solid var(--primary);
    color: var(--t1);
    padding: 10px 16px;
    font-size: 14px;
    border-radius: var(--r-1);
    box-shadow: var(--shadow-md);
}
.toast-bb.success { border-left-color: var(--up); }
.toast-bb.error   { border-left-color: var(--down); }

/* ═══ MODAL ═══ */

.modal-bloomberg .modal-content {
    background: #fff;
    border: 1px solid var(--edge);
    border-radius: var(--r-3);
    color: var(--t1);
    box-shadow: var(--shadow-lg);
}
.modal-bloomberg .modal-header {
    border-bottom: 1px solid var(--edge);
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: var(--r-3) var(--r-3) 0 0;
}
.modal-bloomberg .modal-title {
    font-family: var(--font-data);
    font-size: 14px;
    font-weight: 600;
}
.modal-bloomberg .modal-body { padding: 20px; }
.modal-bloomberg .modal-footer {
    border-top: 1px solid var(--edge);
    padding: 12px 20px;
}
.modal-bloomberg .btn-close { opacity: 0.5; }

/* ═══ LEAFLET ═══ */

.leaflet-container { background: var(--bg-page); border-radius: var(--r-2); }
.leaflet-control-zoom a {
    background: #fff !important;
    color: var(--t1) !important;
    border-color: var(--edge) !important;
    border-radius: var(--r-1) !important;
}
.leaflet-popup-content-wrapper {
    background: #fff;
    color: var(--t1);
    border-radius: var(--r-2);
    font-size: 14px;
    box-shadow: var(--shadow-md);
}
.leaflet-popup-tip { background: #fff; }

/* ═══ DATATABLES ═══ */

.dataTables_wrapper { color: var(--t2); font-size: 14px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: #fff;
    border: 1px solid var(--edge);
    color: var(--t1);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--r-1);
}
table.dataTable { border-collapse: collapse !important; }
table.dataTable thead th {
    background: var(--bg-card) !important;
    color: var(--t3) !important;
    border-bottom: 2px solid var(--edge) !important;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
table.dataTable tbody td {
    background: transparent !important;
    border-bottom: 1px solid var(--edge-light) !important;
    color: var(--t1);
    font-size: 14px;
}
table.dataTable tbody tr:hover td { background: var(--primary-ghost) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--t3) !important;
    border: 1px solid var(--edge) !important;
    background: #fff !important;
    border-radius: var(--r-1) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    color: #fff !important;
    border-color: var(--primary) !important;
    background: var(--primary) !important;
}

/* ═══ CANVAS ═══ */

canvas { max-width: 100%; }

/* ═══ UTILITY ═══ */

.mono { font-family: var(--font-ui); }
.tabnum { font-variant-numeric: tabular-nums; }
.amber { color: var(--primary); }
.up { color: var(--up); }
.down { color: var(--down); }
.dim { color: var(--t3); }

/* ═══ AUTH PAGES ═══ */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E3A5F 0%, #1E4D8C 50%, #2563EB 100%);
    position: relative;
    overflow: hidden;
}

.auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 20%, rgba(108, 180, 238, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(108, 180, 238, 0.05) 0%, transparent 50%);
}

.auth-box {
    background: #fff;
    border: 1px solid var(--edge);
    border-radius: var(--r-3);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.auth-box .auth-head {
    background: var(--bg-card);
    border-bottom: 1px solid var(--edge);
    padding: 24px 32px 20px;
    text-align: center;
    border-radius: var(--r-3) var(--r-3) 0 0;
}

.auth-box .auth-head i {
    font-size: 32px;
    color: var(--primary);
}

.auth-box .auth-head h1 {
    font-family: var(--font-data);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0 4px;
}

.auth-box .auth-head p {
    font-size: 13px;
    color: var(--t3);
    letter-spacing: 0.5px;
}

.auth-box .auth-body { padding: 28px 32px; }
.auth-box .form-row { margin-bottom: 16px; }

.auth-box .btn-amber {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    border-radius: var(--r-2);
}

.auth-box .auth-footer {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--edge);
    font-size: 14px;
    color: var(--t3);
}

.auth-box .auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

.auth-box .auth-error {
    background: var(--down-muted);
    color: var(--down);
    padding: 8px 12px;
    font-size: 14px;
    margin-bottom: 14px;
    display: none;
    border-radius: var(--r-1);
}

.auth-box .hint {
    font-size: 14px;
    color: var(--t3);
    margin-top: 4px;
}

/* ═══ ANIMATE ═══ */

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.stagger > * { animation: fade-up 300ms ease both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }

/* ═══ EMPTY STATE ═══ */

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--t3);
    font-size: 13px;
}

.empty-state i {
    font-size: 28px;
    color: var(--t4);
    display: block;
    margin-bottom: var(--sp-4);
}

/* ═══ MAP CONTROLS ═══ */

.map-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--edge);
    flex-wrap: wrap;
    border-radius: var(--r-2) var(--r-2) 0 0;
}

.map-controls .map-btn-group {
    display: flex;
    gap: 1px;
    border-radius: var(--r-1);
    overflow: hidden;
    border: 1px solid var(--edge);
}

.map-controls .map-btn {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    background: #fff;
    border: none;
    color: var(--t2);
    cursor: pointer;
    transition: all var(--fast);
    white-space: nowrap;
}
.map-controls .map-btn:hover { background: var(--primary-ghost); color: var(--primary); }
.map-controls .map-btn.active { background: var(--primary); color: #fff; }

.map-controls .map-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--t2);
}
.map-controls .map-switch input[type="checkbox"] {
    accent-color: var(--primary);
}

/* Remove scanline effect for light theme */
body::after { display: none; }

/* ═══ PROPERTY DETAIL PANEL ═══ */

.prop-overlay {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(0,0,0,0.5); opacity: 0;
    transition: opacity var(--fast); pointer-events: none;
}
.prop-overlay.open { opacity: 1; pointer-events: all; }

.prop-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 46%; min-width: 480px; max-width: 720px;
    background: var(--bg-panel); border-left: 1px solid var(--edge);
    z-index: 8001; transform: translateX(100%);
    transition: transform 300ms ease;
    display: flex; flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
.prop-panel.open { transform: translateX(0); }

.prop-header {
    padding: 14px 16px; border-bottom: 1px solid var(--edge);
    background: var(--bg-card); flex-shrink: 0;
}
.prop-header-top {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.prop-addr { font-family: var(--font-ui); font-size: 15px; font-weight: 700; color: var(--t1); line-height: 1.3; }
.prop-close {
    background: none; border: none; color: var(--t3); font-size: 18px;
    cursor: pointer; padding: 2px 6px; border-radius: 2px;
}
.prop-close:hover { color: var(--t1); background: var(--bg-card); }
.prop-meta {
    display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap;
    font-family: var(--font-term); font-size: 13px; color: var(--t2);
}
.prop-meta-val { color: var(--amber); font-weight: 700; }
.prop-actions {
    display: flex; gap: 6px; margin-top: 8px;
}
.prop-actions a, .prop-actions button {
    font-family: var(--font-term); font-size: 13px; padding: 3px 8px;
    border: 1px solid var(--edge); border-radius: 2px;
    background: transparent; color: var(--t3); text-decoration: none;
    cursor: pointer; transition: all var(--fast);
}
.prop-actions a:hover, .prop-actions button:hover {
    border-color: var(--amber); color: var(--amber);
}

.prop-body {
    flex: 1; overflow-y: auto; padding: 0;
}

.prop-section {
    padding: 14px 16px; border-bottom: 1px solid var(--edge);
}
.prop-section-title {
    font-family: var(--font-term); font-size: 14px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--t3); margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.prop-section-title i { font-size: 14px; }

.prop-kpi-row {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.prop-kpi {
    flex: 1; min-width: 80px; padding: 6px 8px;
    background: var(--bg-card); border-radius: 2px; border: 1px solid var(--edge);
}
.prop-kpi-label { font-family: var(--font-term); font-size: 14px; color: var(--t3); text-transform: uppercase; }
.prop-kpi-value { font-family: var(--font-data); font-size: 16px; font-weight: 700; color: var(--t1); }
.prop-kpi-sub { font-family: var(--font-term); font-size: 13px; color: var(--t3); }

.prop-tbl { width: 100%; font-family: var(--font-term); font-size: 14px; }
.prop-tbl th {
    text-align: left; padding: 4px 6px; color: var(--t3);
    border-bottom: 1px solid var(--edge); font-weight: 600; text-transform: uppercase;
}
.prop-tbl td { padding: 4px 6px; color: var(--t2); border-bottom: 1px solid var(--edge); }

.prop-ban {
    padding: 6px 10px; border-radius: 2px; font-family: var(--font-term);
    font-size: 14px; font-weight: 700; text-align: center; margin: 8px 0;
}
.prop-ban-red { background: rgba(255,23,68,0.15); color: #FF1744; border: 1px solid rgba(255,23,68,0.3); }
.prop-ban-orange { background: rgba(235,105,9,0.15); color: #EB6909; border: 1px solid rgba(235,105,9,0.3); }
.prop-ban-yellow { background: rgba(255,193,7,0.15); color: #FFC107; border: 1px solid rgba(255,193,7,0.2); }

.prop-timeline { position: relative; padding-left: 20px; }
.prop-timeline::before {
    content: ''; position: absolute; left: 6px; top: 0; bottom: 0;
    width: 2px; background: var(--edge);
}
.prop-timeline-item {
    position: relative; margin-bottom: 12px; font-family: var(--font-term); font-size: 14px;
}
.prop-timeline-item::before {
    content: ''; position: absolute; left: -17px; top: 4px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--amber); border: 2px solid var(--bg-panel);
}
.prop-timeline-date { color: var(--t3); font-weight: 600; }
.prop-timeline-prix { color: var(--amber); font-weight: 700; font-size: 14px; }
.prop-timeline-detail { color: var(--t3); }

.prop-risk-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.prop-risk-item {
    display: flex; align-items: center; gap: 6px; padding: 4px 6px;
    background: var(--bg-card); border-radius: 2px; font-family: var(--font-term); font-size: 13px;
}
.prop-risk-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.prop-risk-dot.low { background: #00C853; }
.prop-risk-dot.medium { background: #FFC107; }
.prop-risk-dot.high { background: #FF1744; }

.prop-minimap { width: 100%; height: 140px; border-radius: 2px; margin-top: 8px; }

@media (max-width: 900px) {
    .prop-panel { width: 100%; min-width: unset; }
}

/* ══════════════════════════════════════════════ */
/* Panneau lateral parcelle (slide-in carte)     */
/* ══════════════════════════════════════════════ */

.parcel-panel {
    position: absolute;
    top: 0; right: 0;
    width: 300px;
    height: 100%;
    background: var(--bg-panel);
    border-left: 1px solid var(--edge);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}
.parcel-panel.open { transform: translateX(0); }

.parcel-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--primary);
    color: #fff;
    font-family: var(--font-term);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.parcel-panel-close {
    background: none; border: none;
    color: rgba(255,255,255,0.7);
    font-size: 16px; line-height: 1;
    cursor: pointer; padding: 0 2px;
    transition: color 0.15s;
}
.parcel-panel-close:hover { color: #fff; }

.parcel-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    font-family: var(--font-term);
    font-size: 13px;
}

/* Glossary tooltips for technical terms */
.glossary-tip {
    border-bottom: 1px dotted var(--t3);
    cursor: help;
    position: relative;
}
.glossary-tip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--t1);
    border: 1px solid var(--edge);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 240px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}
.glossary-tip:hover { color: var(--primary); }

/* Collapsible panel sections */
.parcel-panel-body details > summary { user-select: none; }
.parcel-panel-body details > summary::-webkit-details-marker { display: none; }
.parcel-panel-body details[open] > summary .bi-chevron-down { transform: rotate(180deg); }
.parcel-panel-body details:not([open]) > summary { margin-bottom: 0 !important; }

/* Street View split layout */
#mapSplitContainer.sv-open #mainMap { flex: 0 0 60%; }
#mapSplitContainer.sv-open #streetViewPane { display: block; width: 40%; }
#closeStreetViewBtn:hover { background: rgba(0,0,0,0.8); }

/* Search marker pulse animation */
.search-pulse { animation: searchPulse 2s ease-out infinite; }
@keyframes searchPulse {
    0% { opacity: 0.6; stroke-width: 2; }
    50% { opacity: 0.2; stroke-width: 4; }
    100% { opacity: 0.6; stroke-width: 2; }
}
.search-pin { background: none !important; border: none !important; }
.parcel-panel-body::-webkit-scrollbar { width: 3px; }
.parcel-panel-body::-webkit-scrollbar-track { background: transparent; }
.parcel-panel-body::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 2px; }

.pp-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--edge);
}
.pp-section:last-child { border-bottom: none; }

.pp-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 7px;
}

.pp-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2px 0;
    gap: 6px;
}
.pp-lbl { color: var(--t3); flex-shrink: 0; }

.pp-card {
    background: var(--bg-card);
    border: 1px solid var(--edge);
    border-radius: 3px;
    padding: 7px 9px;
    margin-bottom: 5px;
}

.pp-risk-low  { color: #00C853; font-weight: 700; }
.pp-risk-med  { color: #FFC107; font-weight: 700; }
.pp-risk-hi   { color: #FF1744; font-weight: 700; }

.parcel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
}
.parcel-spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--edge);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ LEAFLET MAP STYLES ═══ */

.leaflet-marker-tooltip {
    background: rgba(15, 15, 15, 0.92);
    border: none;
    border-radius: 6px;
    color: #fff;
    padding: 8px 12px;
    font-size: 14px;
    font-family: var(--font-term, monospace);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    white-space: nowrap;
    pointer-events: none;
}
.leaflet-marker-tooltip::before {
    border-top-color: rgba(15,15,15,0.92) !important;
}

.map-zoom-hint {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,15,15,0.85);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-term, monospace);
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* ═══ DPE BADGES ═══ */

.dpe-badge { display:inline-block; width:18px; height:18px; line-height:18px; text-align:center; font-family:var(--font-term); font-size:9px; font-weight:700; border-radius:2px; color:#fff; }
.dpe-A { background:#009C41; } .dpe-B { background:#50B832; } .dpe-C { background:#C8D200; color:#333; }
.dpe-D { background:#FFED00; color:#333; } .dpe-E { background:#FBBA00; color:#333; }
.dpe-F { background:#EB6909; } .dpe-G { background:#E2001A; }

/* ═══ STATUS TAGS ═══ */

.status-active { color:var(--up); } .status-sold { color:var(--t3); } .status-under_offer { color:var(--amber); } .status-withdrawn { color:var(--down); }
.status-tag { padding:2px 6px; background:var(--bg-input); border:1px solid var(--edge); font-family:var(--font-term); font-size:9px; }

/* ═══ CRM KANBAN ═══ */

.kanban-board { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0; min-height: 300px; }
.kanban-col { flex: 1; min-width: 200px; background: var(--bg-input); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; }
.kanban-col-header { font-family: var(--font-term); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 8px; margin-bottom: 6px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; }
.kanban-col-body { flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 6px; }
.kanban-col-body.drag-over { background: rgba(37,99,235,0.06); border-radius: 6px; }
.kanban-card { background: var(--bg-panel); border: 1px solid var(--edge); border-radius: 6px; padding: 8px 10px; cursor: grab; transition: box-shadow 0.15s, transform 0.15s; }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); }
.kanban-card-title { font-family: var(--font-term); font-size: 13px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-sub { font-family: var(--font-term); font-size: 13px; color: var(--t3); }
.kanban-card-badges { display: flex; gap: 4px; margin-top: 4px; }

/* Prospect detail panel */
.prospect-panel { position: fixed; top: 0; right: 0; width: 420px; max-width: 90vw; height: 100vh; background: var(--bg-panel); border-left: 1px solid var(--edge); z-index: 8001; transform: translateX(100%); transition: transform 0.3s ease; overflow-y: auto; box-shadow: -4px 0 24px rgba(0,0,0,0.1); }
.prospect-panel.open { transform: translateX(0); }
.prospect-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 8000; display: none; }
.prospect-overlay.open { display: block; }
.interaction-timeline { padding: 8px 0; }
.interaction-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--edge); }
.interaction-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }

@media (max-width: 900px) { .kanban-board { flex-direction: column; } .kanban-col { min-width: auto; } }

/* ═══ MAP POPUP BLOOMBERG STYLE ═══ */

.map-popup { font-family: var(--font-term, monospace); font-size: 13px; min-width: 180px; max-width: 240px; }
.mp-title { font-size: 14px; font-weight: 700; color: var(--amber, #F0B429); margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 4px; }
.mp-row { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0; color: #ccc; }
.mp-row strong { color: #fff; text-align: right; }
.mp-source { margin-top: 6px; font-size: 13px; color: #666; font-style: italic; }

/* ═══ LAYER CONTROL PANEL ═══ */

.layer-cat { border-bottom: 1px solid var(--edge); }
.layer-cat-header {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px; cursor: pointer;
    font-family: var(--font-term); font-size: 14px; font-weight: 700;
    color: var(--amber); text-transform: uppercase; letter-spacing: .05em;
    transition: background .15s;
}
.layer-cat-header:hover { background: var(--bg-hover, rgba(255,255,255,.04)); }
.layer-cat-header .cat-arrow { margin-left: auto; font-size: 13px; transition: transform .2s; }
.layer-cat-header .cat-arrow.bi-chevron-up { transform: rotate(180deg); }
.layer-cat-body { padding: 2px 0; }
.layer-cat-body.collapsed { display: none; }
.layer-toggle {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 12px; cursor: pointer;
    font-family: var(--font-mono, monospace); font-size: 14px;
    color: var(--t2, #aaa); transition: background .12s;
}
.layer-toggle:hover { background: rgba(255,255,255,.04); }
.layer-toggle input[type=checkbox] { accent-color: var(--amber); flex-shrink: 0; }
.layer-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.layer-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-badge {
    background: var(--amber); color: #000;
    font-size: 14px; font-weight: 700;
    padding: 0 4px; border-radius: 8px; min-width: 16px; text-align: center;
    display: none;
}
.layer-spinner { margin-left: auto; }

/* ═══ LOADING PLACEHOLDER ═══ */

.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--t3);
    font-family: var(--font-term);
    font-size: 13px;
}
.loading-placeholder .spinner-border {
    margin-right: 6px;
}

/* ═══ UPSELL MODAL ═══ */

.upsell-overlay {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,.65);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .3s;
}
.upsell-overlay.visible { opacity: 1; }
.upsell-modal {
    background: var(--bg-card, #1e2a3a); border: 1px solid var(--edge, #2d3a4a);
    border-radius: 8px; padding: 32px 28px; max-width: 420px; width: 90%;
    text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.upsell-icon { font-size: 36px; color: #F59E0B; margin-bottom: 12px; }
.upsell-title { color: var(--t1, #e6edf3); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.upsell-msg { color: var(--t2, #8b949e); font-size: 13px; line-height: 1.6; margin-bottom: 24px; }
.upsell-btn {
    display: inline-block; background: #27AE60; color: #fff; font-weight: 600;
    padding: 10px 28px; border-radius: 5px; font-size: 14px;
    text-decoration: none; transition: background .2s;
}
.upsell-btn:hover { background: #219a52; color: #fff; }
.upsell-dismiss {
    display: block; margin-top: 12px; color: var(--t3, #6e7681);
    font-size: 14px; text-decoration: none;
}
.upsell-dismiss:hover { color: var(--t2, #8b949e); }
