/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0b0d11;
    --bg2:       #0f111a;
    --card:      #111318;
    --card2:     #161820;
    --border:    #1e2130;
    --border2:   #252838;
    --green:     #22c55e;
    --green-dim: #16a34a;
    --green-bg:  rgba(34, 197, 94, .08);
    --green-glow:rgba(34, 197, 94, .15);
    --blue:      #3b82f6;
    --orange:    #f97316;
    --red:       #ef4444;
    --text:      #f1f5f9;
    --text2:     #94a3b8;
    --text3:     #64748b;
    --radius:    14px;
    --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Navbar ───────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 17, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand { display: flex; align-items: center; }

.brand-d8 {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -.5px;
    color: var(--text);
}
.brand-d8 em {
    font-style: normal;
    color: var(--green);
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; }

.nav-link {
    font-size: .875rem;
    font-weight: 500;
    color: var(--text2);
    transition: color .2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }

.staff-link {
    background: var(--green-bg);
    border: 1px solid rgba(34,197,94,.25);
    color: var(--green);
    padding: .35rem .9rem;
    border-radius: 100px;
    font-size: .8rem;
    font-weight: 600;
}
.staff-link:hover { background: rgba(34,197,94,.15); color: var(--green); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.d8-hero {
    background: linear-gradient(to bottom, #0d1020, var(--bg));
    border-bottom: 1px solid var(--border);
    padding: 3.5rem 2rem 2.5rem;
    text-align: center;
}

.hero-inner { max-width: 640px; margin: 0 auto; }

.hero-sub {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: .75rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: .75rem;
}
.hero-title span { color: var(--green); }

.hero-desc {
    font-size: .9rem;
    color: var(--text2);
}

/* ── Filter panel ─────────────────────────────────────────────────── */
.filter-wrap {
    max-width: 1280px;
    margin: 1.5rem auto 0;
    padding: 0 2rem;
}

.filter-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-row-main {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 0 .9rem;
}
.filter-search svg { width: 16px; height: 16px; color: var(--text3); flex-shrink: 0; }
.filter-search .filter-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: .875rem;
    height: 40px;
    outline: none;
}
.filter-search .filter-input::placeholder { color: var(--text3); }

.filter-selects { display: flex; gap: .75rem; }

.fs-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.fs-wrap > svg:first-child {
    position: absolute;
    left: .75rem;
    width: 15px;
    height: 15px;
    color: var(--text3);
    pointer-events: none;
    z-index: 1;
}
.filter-sel {
    appearance: none;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .8rem;
    height: 40px;
    padding: 0 2.2rem 0 2.25rem;
    cursor: pointer;
    outline: none;
}
.filter-sel:focus { border-color: var(--green); }
.fs-chevron {
    position: absolute;
    right: .5rem;
    width: 14px;
    height: 14px;
    color: var(--text3);
    pointer-events: none;
}

.filter-row-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.price-range {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.pr-label { font-size: .8rem; font-weight: 600; color: var(--text2); white-space: nowrap; }
.pr-input-wrap { display: flex; align-items: center; gap: .4rem; }
.pr-input {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .8rem;
    height: 36px;
    width: 90px;
    padding: 0 .75rem;
    outline: none;
}
.pr-input:focus { border-color: var(--green); }
.pr-sep { color: var(--text3); font-size: .85rem; }
.pr-cur { font-size: .8rem; color: var(--text2); font-weight: 600; }

.filter-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }

.btn-sort {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: var(--card2);
    border: 1px solid var(--border2);
    border-radius: 100px;
    color: var(--text2);
    font-size: .78rem;
    font-weight: 600;
    padding: .4rem 1rem;
    transition: all .2s;
}
.btn-sort svg { width: 14px; height: 14px; }
.btn-sort:hover, .btn-sort.active { border-color: var(--green); color: var(--green); background: var(--green-bg); }

.btn-reset {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: rgba(59,130,246,.08);
    border: 1px solid rgba(59,130,246,.2);
    border-radius: 100px;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 600;
    padding: .4rem 1rem;
    transition: all .2s;
}
.btn-reset svg { width: 13px; height: 13px; }
.btn-reset:hover { background: rgba(59,130,246,.15); }

.btn-search {
    background: var(--green);
    color: #000;
    border: none;
    border-radius: 100px;
    font-size: .8rem;
    font-weight: 700;
    padding: .45rem 1.25rem;
    transition: background .2s;
}
.btn-search:hover { background: var(--green-dim); }

/* ── Catalog grid ─────────────────────────────────────────────────── */
.catalog-wrap {
    max-width: 1280px;
    margin: 2rem auto 3rem;
    padding: 0 2rem;
}

.biens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.bien-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.bien-card:hover {
    border-color: rgba(34,197,94,.4);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(34,197,94,.1);
}

.bien-card-img {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--card2);
}
.bien-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.bien-card:hover .bien-card-img img { transform: scale(1.04); }

.bien-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bien-card-no-img svg { width: 40px; height: 40px; color: var(--text3); }

.bien-card-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    background: rgba(11,13,17,.85);
    border: 1px solid rgba(34,197,94,.3);
    color: var(--green);
    font-size: .7rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border-radius: 100px;
    backdrop-filter: blur(6px);
}

.bien-card-body { padding: 1rem 1.1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }

.bien-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
}

.bien-card-quartier {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: var(--text2);
}
.bien-card-quartier svg { width: 12px; height: 12px; flex-shrink: 0; }

.bien-card-footer {
    margin-top: auto;
    padding-top: .6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bien-card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -.5px;
}

.bien-card-etat {
    font-size: .72rem;
    font-weight: 600;
    background: var(--card2);
    border: 1px solid var(--border2);
    padding: .2rem .6rem;
    border-radius: 100px;
    color: var(--text2);
}
.bien-card-etat.etat-ok {
    background: var(--green-bg);
    border-color: rgba(34,197,94,.25);
    color: var(--green);
}

/* ── Pagination ───────────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-top: 2.5rem;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    color: var(--text2);
    transition: all .2s;
}
.page-btn svg { width: 16px; height: 16px; }
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); border-color: var(--green); color: #000; }

/* ── Property Detail ──────────────────────────────────────────────── */
.bien-detail-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.bien-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.bien-detail-meta { flex: 1; }

.detail-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--green);
    display: block;
    margin-bottom: .5rem;
}

.detail-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: .6rem;
}

.detail-underline {
    width: 56px;
    height: 3px;
    background: var(--green);
    border-radius: 2px;
    margin-bottom: .9rem;
}

.detail-tags { display: flex; flex-wrap: wrap; gap: .5rem; }

.detail-tag {
    background: rgba(34,197,94,.06);
    border: 1px solid rgba(34,197,94,.25);
    color: var(--green);
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem .85rem;
    border-radius: 100px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text2);
    font-size: .8rem;
    font-weight: 500;
    padding: .5rem 1rem;
    white-space: nowrap;
    transition: all .2s;
}
.btn-back svg { width: 16px; height: 16px; }
.btn-back:hover { border-color: var(--border2); color: var(--text); }

/* Detail body: 2 columns */
.bien-detail-body {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

/* Gallery */
.bien-gallery { display: flex; flex-direction: column; gap: .75rem; }

.gallery-main {
    position: relative;
    aspect-ratio: 16/10;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-counter {
    position: absolute;
    bottom: .75rem;
    right: .75rem;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: .25rem .7rem;
    border-radius: 100px;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.gallery-nav svg { width: 18px; height: 18px; }
.gallery-nav:hover { background: rgba(0,0,0,.85); }
.gallery-prev { left: .75rem; }
.gallery-next { right: .75rem; }

.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    min-height: 280px;
    color: var(--text3);
}
.gallery-empty svg { width: 48px; height: 48px; }
.gallery-empty p { font-size: .875rem; }

.gallery-thumbs { display: flex; gap: .6rem; flex-wrap: wrap; }

.gallery-thumb {
    width: 80px;
    height: 58px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--card);
    transition: border-color .2s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--green); }
.gallery-thumb:hover { border-color: rgba(34,197,94,.5); }

/* Price card */
.bien-price-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 80px;
}

.price-card-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text3);
}

.price-card-amount {
    display: flex;
    align-items: baseline;
    gap: .4rem;
}
.price-big {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--text);
    line-height: 1;
}
.price-cur {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green);
}

.price-card-divider { height: 1px; background: var(--border); }

.price-card-features { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.price-card-features li {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .875rem;
    color: var(--text2);
}

.feat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--green);
}

.btn-reserver {
    background: var(--green);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 700;
    padding: .85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background .2s, transform .1s;
    width: 100%;
}
.btn-reserver svg { width: 17px; height: 17px; }
.btn-reserver:hover { background: #16a34a; transform: translateY(-1px); }

.price-card-note {
    font-size: .75rem;
    color: var(--text3);
    text-align: center;
    line-height: 1.5;
}

/* Stats grid */
.bien-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.stat-card-wide { grid-column: 1 / -1; }

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; }

.stat-icon-orange { background: rgba(249,115,22,.12); color: var(--orange); border: 1px solid rgba(249,115,22,.2); }
.stat-icon-green  { background: rgba(34,197,94,.1);  color: var(--green);  border: 1px solid rgba(34,197,94,.2); }
.stat-icon-blue   { background: rgba(59,130,246,.1); color: var(--blue);   border: 1px solid rgba(59,130,246,.2); }
.stat-icon-gray   { background: rgba(148,163,184,.06); color: var(--text2); border: 1px solid rgba(148,163,184,.15); }

.stat-label { font-size: .72rem; color: var(--text3); font-weight: 500; }
.stat-value { font-size: .95rem; font-weight: 700; color: var(--text); }
.stat-desc  { font-size: .85rem; font-weight: 400; color: var(--text2); white-space: pre-wrap; }

/* ── Footer ───────────────────────────────────────────────────────── */
.d8-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: .8rem;
    color: var(--text3);
}

/* ── Empty state ──────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.empty-state svg { width: 48px; height: 48px; }
.empty-state p { font-size: .95rem; }

/* ── Admin Layout ─────────────────────────────────────────────────── */
.admin-body,
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; }

.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
}

.table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead th {
    text-align: left;
    padding: .9rem 1.2rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    background: var(--card2);
    font-weight: 600;
}
.table-wrap tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
.table-wrap tbody tr:last-child { border-bottom: none; }
.table-wrap tbody tr:hover { background: rgba(255,255,255,.02); }
.table-wrap tbody td { padding: .85rem 1.2rem; font-size: .875rem; }

.admin-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.sidebar-staff-label { font-size: .7rem; color: var(--text3); letter-spacing: 1px; text-transform: uppercase; }

.sidebar-nav {
    padding: 1rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
}

.sn-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .835rem;
    font-weight: 500;
    color: var(--text2);
    transition: all .15s;
}
.sn-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sn-link:hover { background: var(--bg2); color: var(--text); }
.sn-link.active { background: var(--green-bg); color: var(--green); }

.sidebar-sep { border: none; border-top: 1px solid var(--border); margin: .5rem 0; }
.sn-logout { color: var(--red); }
.sn-logout:hover { background: rgba(239,68,68,.08); color: var(--red); }

.admin-main {
    flex: 1;
    margin-left: 230px;
    padding: 2rem;
    max-width: calc(100vw - 230px);
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.admin-page-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -.5px; }
.admin-welcome { font-size: .85rem; color: var(--text2); }

/* Admin stat cards */
.admin-stats-row { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }

.admin-stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 180px;
}
.asc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.asc-icon svg { width: 20px; height: 20px; }
.asc-green { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,.2); }
.asc-blue  { background: rgba(59,130,246,.08); color: var(--blue); border: 1px solid rgba(59,130,246,.2); }
.asc-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.asc-label { font-size: .78rem; color: var(--text2); margin-top: .2rem; }

/* Admin section */
.admin-section { margin-bottom: 2rem; }
.admin-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.admin-section-header h3 { font-size: 1rem; font-weight: 700; }
.admin-see-all { font-size: .8rem; color: var(--green); }
.admin-see-all:hover { text-decoration: underline; }

/* Admin table */
.admin-table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.admin-table th {
    background: var(--card2);
    padding: .75rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text2);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg2); }
.admin-table td strong { color: var(--text); }

.admin-thumb {
    width: 60px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.admin-thumb-empty {
    width: 60px;
    height: 42px;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-thumb-empty svg { width: 18px; height: 18px; color: var(--text3); }

.td-actions { display: flex; gap: .4rem; }

.ta-btn {
    font-size: .72rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border-radius: 6px;
    border: 1px solid;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    background: none;
}
.ta-view   { border-color: rgba(59,130,246,.3); color: var(--blue); }
.ta-view:hover   { background: rgba(59,130,246,.08); }
.ta-edit   { border-color: rgba(34,197,94,.3); color: var(--green); }
.ta-edit:hover   { background: var(--green-bg); }
.ta-delete { border-color: rgba(239,68,68,.3); color: var(--red); }
.ta-delete:hover { background: rgba(239,68,68,.08); }

/* Admin form */
.admin-form { display: flex; flex-direction: column; gap: 1.5rem; max-width: 860px; }

.form-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-section-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text2);
    margin-bottom: .25rem;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.2rem; }
.form-group:last-of-type { margin-bottom: 0; }
.form-label { font-size: .75rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }

.form-input {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: .875rem;
    padding: .6rem .9rem;
    outline: none;
    width: 100%;
    transition: border-color .2s;
}
.form-input:focus { border-color: var(--green); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    padding: .55rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.btn-primary  { background: var(--green); color: #000; }
.btn-primary:hover { background: var(--green-dim); }
.btn-secondary { background: var(--card2); border-color: var(--border2); color: var(--text2); }
.btn-secondary:hover { color: var(--text); border-color: var(--border); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost    { background: transparent; border-color: var(--border2); color: var(--text2); }
.btn-ghost:hover  { border-color: var(--border); color: var(--text); background: var(--card2); }

/* Image upload zone */
.img-upload-zone {
    background: var(--bg2);
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.img-upload-zone:hover, .img-upload-zone.dragover {
    border-color: var(--green);
    background: var(--green-bg);
}
.img-upload-zone svg { width: 32px; height: 32px; color: var(--text3); }
.img-upload-zone p { font-size: .875rem; color: var(--text2); }
.img-upload-zone span { font-size: .75rem; color: var(--text3); }
.upload-link { color: var(--green); cursor: pointer; font-weight: 600; }

.img-previews { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
.img-preview-item {
    position: relative;
    width: 100px;
    height: 75px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.img-keep-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.75);
    font-size: .65rem;
    color: #fff;
    padding: .2rem .4rem;
    display: flex;
    align-items: center;
    gap: .3rem;
    cursor: pointer;
}

/* Categories admin */
.cat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; align-items: start; }

.cat-add-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.cat-add-card h4 { font-size: .9rem; font-weight: 700; }
.cat-add-form { display: flex; flex-direction: column; gap: .75rem; }

.cat-list-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.cat-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }

.cat-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: .7rem 1rem;
    cursor: default;
    transition: border-color .15s;
}
.cat-item.dragging { opacity: .5; }
.cat-item:hover { border-color: var(--border); }

.cat-drag-handle { color: var(--text3); cursor: grab; font-size: 1rem; user-select: none; }
.cat-drag-handle:active { cursor: grabbing; }

.cat-name {
    flex: 1;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
}
.cat-name:hover { color: var(--green); }

.cat-rename-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--green);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: .875rem;
    padding: .2rem .5rem;
    outline: none;
}

.cat-delete-btn {
    background: none;
    border: none;
    color: var(--text3);
    font-size: .9rem;
    padding: .15rem .4rem;
    border-radius: 4px;
    transition: all .15s;
}
.cat-delete-btn:hover { background: rgba(239,68,68,.1); color: var(--red); }
.cat-delete-form { margin: 0; }

/* Alert */
.alert {
    padding: .85rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    margin-bottom: 1rem;
}
.alert-error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25); color: var(--green); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 440px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.modal-box h3 { font-size: 1.1rem; font-weight: 700; }
.modal-box p  { font-size: .875rem; color: var(--text2); }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ── Dual price (admin form) ──────────────────────────────────────── */
.form-hint { font-size: .8rem; color: var(--text3); margin-top: -.25rem; }

.price-dual-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.price-dual-card {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.price-dual-label { display: flex; align-items: center; }

.price-type-badge {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: .25rem .7rem;
    border-radius: 100px;
}
.price-type-loc { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25); color: var(--green); }
.price-type-ach { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25); color: var(--blue); }

.price-dual-input {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.price-dual-input .form-input { flex: 1; }
.price-input-cur { font-size: .85rem; font-weight: 700; color: var(--text2); }

/* ── Dual price (detail page) ─────────────────────────────────────── */
.dual-price-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.dual-price-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.dual-loc { align-items: flex-start; }
.dual-ach { align-items: flex-end; text-align: right; }
.dual-price-sep {
    width: 1px;
    background: var(--border);
    margin: 0 1rem;
}

/* ── Price tags (detail page header) ─────────────────────────────── */
.detail-tag-loc { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.25); color: var(--green); }
.detail-tag-ach { background: rgba(59,130,246,.06); border-color: rgba(59,130,246,.25); color: var(--blue); }

/* ── Card dual prices ─────────────────────────────────────────────── */
.bien-card-prices {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    line-height: 1.2;
}
.bcp-loc {
    font-size: .95rem;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -.3px;
}
.bcp-loc em { font-style: normal; font-size: .65rem; font-weight: 500; color: var(--green-dim); }
.bcp-ach {
    font-size: .85rem;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: -.3px;
}
.bcp-ach em { font-style: normal; font-size: .65rem; font-weight: 500; color: rgba(59,130,246,.6); }

/* ── Responsive */
@media (max-width: 900px) {
    .bien-detail-body { grid-template-columns: 1fr; }
    .bien-price-card  { position: static; }
    .filter-row-main  { flex-direction: column; align-items: stretch; }
    .filter-selects   { flex-direction: row; }
    .filter-row-price { flex-direction: column; align-items: flex-start; }
    .filter-actions   { margin-left: 0; }
    .cat-layout       { grid-template-columns: 1fr; }
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .admin-sidebar { display: none; }
    .admin-main    { margin-left: 0; max-width: 100vw; padding: 1rem; }
    .biens-grid    { grid-template-columns: 1fr 1fr; }
    .bien-stats    { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
    .biens-grid    { grid-template-columns: 1fr; }
    .bien-stats    { grid-template-columns: 1fr; }
}

/* Hide number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.per-page-bar { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: 1.5rem 0 .5rem; flex-wrap: wrap; }
.per-page-bar label { font-size: .82rem; color: var(--text2); }
.per-page-select {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 38px 10px 14px;
    font-size: .9rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    transition: border-color .15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}
.per-page-select:hover,
.per-page-select:focus { border-color: var(--green); }
.per-page-select option { background: var(--card); }
