/* ==========================================================
   MARRAKECH ANNONCES - STYLE GLOBAL
   Design Island, mobile first, lisible, senior friendly
   ========================================================== */

/* ==========================================================
   VARIABLES
   ========================================================== */

:root {
    --bg: #ebe7e2;
    --card: #ffffff;

    --green: #2f6f57;
    --green-dark: #245744;
    --terracotta: #c96c4a;

    --primary: var(--green);
    --accent: var(--terracotta);

    --text: #252525;
    --muted: #6f6f6f;

    --border: #ddd6cf;
    --soft: #f5f2ef;
    --soft-2: #faf8f6;

    --danger: #b8332f;
    --warning: #8a5a00;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    --shadow-card: 0 10px 25px rgba(0, 0, 0, .08);
    --container: 1300px;
}

/* ==========================================================
   BASE
   ========================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f1e7e2;
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: Arial, sans-serif;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.container,
.site-main {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

.site-main {
    min-height: calc(100vh - 160px);
}

/* ==========================================================
   HEADER / FOOTER
   ========================================================== */

.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 0;
}

.site-logo{
    display:flex;
    align-items:center;
    text-decoration:none;
}

.site-logo img{
    height:52px;
    width:auto;
    display:block;
}

.main-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--green-dark);
    background: var(--soft);
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    font-weight: bold;
    text-decoration: none;
}

.main-nav a i {
    width: 18px;
    text-align: center;
    font-size: 16px;
}

.site-footer {
    margin-top: 40px;
    background: var(--card);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 20px;
}

.site-footer p {
    margin: 0;
    color: var(--muted);
}

/* ==========================================================
   PAGE HEADER
   ========================================================== */

.page-header,
.admin-page-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 24px 0 18px;
}

.page-header h1,
.admin-page-header h1 {
    margin: 0;
    color: var(--terracotta);
    font-size: 30px;
    line-height: 1.2;
}

.intro {
    display: none;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 16px;
}

.btn-add,.detail-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--terracotta);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 13px 16px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: background .2s ease;
}

.btn-add:hover {
    background: #b85f40;
}

.btn-add:active {
    transform: translateY(1px);
}

/* ==========================================================
   MESSAGES / BADGES
   ========================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-pill);
    padding: 5px 10px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-attente {
    background: #fff2d8;
    color: var(--warning);
}

.badge-publiee {
    background: #e7f1ed;
    color: var(--green);
}

.badge-rejetee {
    background: #f8dddd;
    color: var(--danger);
}

.badge-vendu,
.badge-trouve {
    background: #eeeeee;
    color: #555;
}

.badge-archivee {
    background: #f1eee9;
    color: var(--muted);
}

.flash-message,
.alert-success,
.alert-error,
.alert-info {
    padding: 13px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 600;
}

.flash-success,
.alert-success {
    background: #e7f1ed;
    color: var(--green);
    border-left: 5px solid var(--green);
}

.flash-error,
.alert-error {
    background: #f8dddd;
    color: var(--danger);
    border-left: 5px solid var(--danger);
}

.flash-warning {
    background: #fff2d8;
    color: var(--warning);
    border-left: 5px solid var(--terracotta);
}

.flash-info,
.alert-info {
    background: #edf4f7;
    color: var(--green-dark);
    border-left: 5px solid var(--green-dark);
}

/* ==========================================================
   FORMULAIRES
   ========================================================== */

.annonce-form,
.admin-form,
.profile-form {
    max-width: 760px;
    margin: 0 auto;
}

.profile-form {
    max-width: 900px;
}

.form-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 18px;
    margin-bottom: 18px;
}

.form-section h2 {
    margin: 0 0 16px;
    font-size: 22px;
    color: var(--green-dark);
}

.form-section label,
.login-card label {
    display: block;
    font-weight: bold;
    margin-bottom: 7px;
    color: var(--text);
}

.form-section input,
.form-section select,
.form-section textarea {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 17px;
    margin-bottom: 15px;
    background: #f6f6f6;
}

.form-section textarea {
    resize: vertical;
    line-height: 1.5;
}

.help {
    margin: 0 0 12px;
    color: var(--terracotta);
    font-size: 15px;
}

.btn-submit,
.btn-login,
.btn-filter {
    border: 0;
    background: var(--green);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    min-height: 56px;
    border-radius: 16px;
    font-size: 18px;
}

.radio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.radio-card,
.checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
}

.radio-card {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    cursor: pointer;
}

.radio-card input,
.checkbox-line input {
    width: auto;
    min-height: auto;
    margin: 0;
}

.radio-card span {
    font-weight: bold;
    color: var(--green-dark);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.btn-cancel:hover {
    background: #ececec;
}

.btn-submit {
    flex: 1;
}

/* ==========================================================
   LOGIN / RESET PASSWORD
   ========================================================== */

.login-page {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 26px;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo h1 {
    margin: 0;
    color: var(--green-dark);
}

.login-logo p {
    color: var(--muted);
}

.login-card input {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 12px 14px;
    font-size: 17px;
    margin-bottom: 16px;
    background: #F9F9F9;
    color: var(--text);
}

.login-card input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(47, 111, 87, .15);
}

.btn-login {
    width: 100%;
    min-height: 56px;
    border-radius: 16px;
    font-size: 18px;
}

.login-links {
    text-align: center;
    margin-top: 18px;
}

.login-links a {
    color: var(--green);
    font-weight: bold;
    text-decoration: none;
}

/* ==========================================================
   FILTRES / TABS / GRILLES
   ========================================================== */

.filters-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 14px;
    margin-bottom: 16px;
}

.filters-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) max-content max-content;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.filters-grid input,
.filters-grid select {
    width: 100%;
    min-width: 0;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 11px 13px;
    font-size: 16px;
    background: #fff;
}

.btn-filter,
.btn-filter-reset {
    min-height: 46px;
    border-radius: var(--radius-md);
    font-size: 16px;
    padding: 10px 20px;
}

.filters-grid .btn-filter,
.filters-grid .btn-filter-reset {
    min-width: 145px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-filter-reset {
    background: #6c757d;
    color: #fff;
    text-decoration: none;
}

.btn-filter-reset:hover {
    background: #5a6268;
}

.type-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 18px;
    padding-bottom: 2px;
}

.type-tabs a {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--green-dark);
    padding: 11px 16px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
}

.type-tabs a.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.annonces-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.empty-state {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    color: var(--muted);
    font-weight: bold;
    text-align: center;
}

/* ==========================================================
   CARTE ANNONCE
   ========================================================== */

.annonce-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

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

.annonce-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f1eee9;
}

.annonce-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.annonce-content {
    padding: 14px;
}

.annonce-headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.annonce-right,
.annonce-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.annonce-badges {
    flex-wrap: wrap;
    gap: 6px;
}

.annonce-type {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .25px;
}

.annonce-type-offre {
    background: var(--green);
}

.annonce-type-demande {
    background: var(--terracotta);
}

.annonce-ref {
    color: var(--terracotta);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .3px;
    margin-bottom: 7px;
}

.annonce-title {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.3;
    color: var(--green-dark);
}

.annonce-info-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.annonce-info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.annonce-info-item i {
    width: 16px;
    color: var(--terracotta);
    text-align: center;
    margin-top: 2px;
}

.annonce-separator {
    font-size: 10px;
    color: #aaa !important;
    margin: 0 4px;
}

.annonce-price {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--green);
    font-size: 20px;
    font-weight: 900;
}

.annonce-reject-reason {
    margin-top: 12px;
    background: #fff1ef;
    color: var(--danger);
    border-left: 5px solid var(--danger);
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
}

.favori-form {
    margin: 0;
}

.btn-favori {
    border: 0;
    background: #fff1f2;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 18px;
}

.favori-icon {
    color: #dc3545;
    font-size: 18px;
}

/* ==========================================================
   BOUTONS GENERIQUES
   ========================================================== */

.btn-card {
    min-height: 42px;
    border-radius: 12px;
    background: #f4f1ee;
    color: var(--green-dark);
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-card-primary {
    background: var(--green);
    color: #fff;
}

.btn-card-danger {
    background: var(--danger);
    color: #fff;
}

/* ==========================================================
   ADMIN
   ========================================================== */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-card,
.admin-table-card,
.admin-quick-links a {
    background: var(--card);
    border: 1px solid var(--border);
}

.dashboard-card {
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
}

.dashboard-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--green);
}

.dashboard-label {
    color: var(--muted);
    margin-top: 6px;
}

.admin-nav,
.admin-quick-links {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-nav {
    display: flex;
    overflow-x: auto;
    margin: 0 0 18px;
    padding-bottom: 2px;
}

.admin-nav a,
.admin-quick-links a {
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--green-dark);
    font-weight: bold;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    white-space: nowrap;
}

.admin-nav a.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.admin-nav a:hover {
    border-color: var(--green);
}

.admin-quick-links a {
    padding: 14px;
}

.admin-table-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 18px;
}

.table-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.table-header h2 {
    margin: 0;
}

.table-responsive {
    overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: var(--soft-2);
    color: var(--green-dark);
}

.admin-table a {
    color: var(--green-dark);
    text-decoration: none;
    font-weight: bold;
}

.admin-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
}

.admin-filters input,
.admin-filters select {
    width: 100%;
    min-height: 44px;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: #fff;
}

.admin-filters .btn-filter {
    white-space: nowrap;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-mini {
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    color: var(--green-dark);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
}

.btn-success {
    background: var(--green);
    color: #fff !important;
}

.btn-danger {
    background: var(--danger);
    color: #fff !important;
}

.muted-small {
    color: var(--muted);
    font-size: 14px;
}

.status-active {
    color: var(--green);
    font-weight: bold;
}

.status-blocked {
    color: var(--danger);
    font-weight: bold;
}

.admin-layout {
    display: grid;
    gap: 20px;
}

.admin-form-column,
.admin-list-column {
    min-width: 0;
}

/* ==========================================================
   STATISTIQUES
   ========================================================== */

.stats-bars {
    padding: 16px;
}

.stats-row {
    display: grid;
    grid-template-columns: 90px 1fr 40px;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.stats-label {
    font-size: 14px;
    font-weight: 600;
}

.stats-bar {
    height: 12px;
    background: var(--bg);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    background: var(--green);
}

.stats-value {
    text-align: right;
    font-weight: bold;
}

/* ==========================================================
   GALERIE CREATION / MODIFICATION
   ========================================================== */

.gallery-edit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.image-edit-item {
    position: relative;
    display: inline-block;
    width: 160px;
    height: 160px;
}

.image-edit-item img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
    display: block;
}

.delete-badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: #dc3545;
    color: #fff !important;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.delete-badge input {
    display: none;
}

.delete-badge:hover {
    background: #bb2d3b;
}

.image-marked-delete img {
    opacity: .35;
    filter: grayscale(100%);
}

.image-marked-delete .delete-badge {
    background: #555;
}

.image-marked-delete .delete-badge::after {
    content: " ✓";
}

/* ==========================================================
   DETAIL ANNONCE
   ========================================================== */

.detail-page-mockup {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 0 42px;
}

.detail-top-bar {
    margin-bottom: 16px;
}

/*.detail-back-link {*/
/*    display: inline-flex;*/
/*    align-items: center;*/
/*    gap: 10px;*/
/*    padding: 11px 18px;*/
/*    background: #fff;*/
/*    color: var(--text);*/
/*    border: 1px solid var(--border);*/
/*    border-radius: 12px;*/
/*    text-decoration: none;*/
/*    font-weight: 800;*/
/*    font-size: 15px;*/
/*    box-shadow: 0 6px 18px rgba(37, 37, 37, .05);*/
/*}*/

.detail-grid-mockup {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) 380px;
    gap: 20px;
    align-items: start;
}

.detail-left,
.detail-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.detail-right{
    display:flex;
    flex-direction:column;
    gap:18px;
    min-width:0;
}

.detail-island {
    background: var(--card);
    border: 1px solid rgba(221, 214, 207, .9);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(37, 37, 37, .055);
}

.detail-gallery-island {
    padding: 0;
    overflow: hidden;
}

.detail-gallery-main {
    position: relative;
    background: #f3f0ec;
}

.detail-gallery-main img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.gallery-count {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(37, 37, 37, .72);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 14px;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}

.gallery-nav.prev {
    left: 14px;
}

.gallery-nav.next {
    right: 14px;
}

.detail-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px;
    background: #fff;
}

.detail-thumb {
    width: 108px;
    height: 76px;
    border-radius: 11px;
    overflow: hidden;
    border: 2px solid transparent;
    flex: 0 0 auto;
    cursor: pointer;
    background: #f3f0ec;
}

.detail-thumb.active {
    border-color: var(--green);
}

.detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.detail-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-type-offre {
    background: var(--green);
}

.detail-type-demande {
    background: var(--terracotta);
}

.detail-reference {
    color: var(--terracotta);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .2px;
}

.detail-title-new {
    font-size: 18px;
    line-height: 1.18;
    margin: 0 0 18px;
    color: #1f2933;
    font-weight: 900;
}

.detail-info-separator {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}

.detail-info-line {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--text);
    font-size: 16px;
    margin-top: 12px;
}

.detail-info-icon {
    width: 22px;
    flex: 0 0 22px;
    color: var(--green);
}

.detail-price-new {
    color: var(--green);
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
    margin: 20px 0;
}

.detail-date-box {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f7f4f0;
    border-radius: 13px;
    padding: 14px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    font-weight: bold;
}

.detail-date-icon {
    color: var(--green);
    font-size: 22px;
}

.section-title-new {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--terracotta);
    font-size: 20px;
    font-weight: 900;
    margin: 0 0 16px;
}

.description-text-new {
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--text);
}

.seller-card h2 {
    color: var(--terracotta);
}

.seller-name {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 5px;
    color: #1f2933;
}

.seller-meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.contact-actions,
.detail-actions-list,
.admin-actions-new {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    border-radius: 10px;
    padding: 13px;
    text-decoration: none;
    font-weight: 900;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.contact-btn.whatsapp {
    background: linear-gradient(135deg, #54bf6b, #2f9f4e);
}

.detail-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
    padding: 12px 14px;
    text-decoration: none;
    font-weight: 900;
    font-size: 15px;
}

.detail-action-btn.danger {
    border-color: rgba(184, 51, 47, .55);
    color: var(--danger);
}

.detail-action-favori {
    background: #fff;
    border: 2px solid #b8543a;
    color: #b8543a;
}

.detail-action-favori i {
    color: inherit;
}

.detail-action-favori:hover {
    background: #b8543a;
    color: #fff;
}

.detail-action-favori:hover i {
    color: #fff;
}

.reject-card-new {
    border-color: rgba(184, 51, 47, .25);
    background: #fff8f7;
}

.reject-card-new h2,
.reject-card-new p {
    color: var(--danger);
}

.admin-info-grid-new {
    display: grid;
    gap: 10px;
    font-size: 14px;
}

.admin-info-grid-new div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.admin-info-grid-new div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.similar-section {
    margin-top: 0;
}

.similar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.similar-card {
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    background: #fff;
}

.similar-card img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    display: block;
    background: #f3f0ec;
}

.similar-body {
    padding: 11px;
}

.similar-price {
    color: var(--green);
    font-weight: 900;
    margin-bottom: 5px;
}

.similar-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 4px;
}

.similar-city {
    color: var(--muted);
    font-size: 13px;
}

.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 18px;
}

.detail-overlay.active {
    display: flex;
}

.detail-overlay img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
}

.close-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    font-size: 26px;
    cursor: pointer;
}

.detail-info-icon i,
.detail-date-icon i,
.section-title-new i,
.contact-btn i,
.detail-action-btn i,
.detail-back-link i {
    width: 18px;
    text-align: center;
}

.fa-whatsapp {
    font-size: 1.05em;
}

/* ==========================================================
   BACK TO TOP
   ========================================================== */

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--green);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    z-index: 200;
}

.back-to-top.visible {
    display: block;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (min-width: 650px) {
    .radio-grid {
        grid-template-columns: 1fr 1fr;
    }

    .annonces-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 700px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .header-inner,
    .page-header,
    .admin-page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .site-main {
        padding: 0 24px;
    }

    .annonces-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-cards,
    .admin-quick-links {
        grid-template-columns: repeat(4, 1fr);
    }

    .admin-filters {
        grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(120px, 1fr)) auto;
        align-items: center;
    }
}

@media (min-width: 1100px) {
    .admin-layout {
        grid-template-columns: 420px 1fr;
        align-items: start;
    }
}

@media (min-width: 1250px) {
    .annonces-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 980px) {
    .detail-grid-mockup {
        grid-template-columns: 1fr;
    }

    .detail-right {
        position: static;
    }

    .similar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .filters-grid,
    .admin-filters {
        grid-template-columns: 1fr;
    }

    .filters-grid .btn-filter,
    .filters-grid .btn-filter-reset,
    .admin-filters .btn-filter {
        width: 100%;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .detail-page-mockup {
        padding: 14px 0 30px;
    }

    .detail-island {
        border-radius: 14px;
        padding: 15px;
    }

    .detail-gallery-island {
        padding: 0;
    }

    .detail-title-row {
        align-items: flex-start;
    }

    .detail-title-new {
        font-size: 24px;
    }

    .detail-price-new {
        font-size: 28px;
    }

    .gallery-nav {
        width: 38px;
        height: 38px;
        font-size: 24px;
    }

    .detail-thumb {
        width: 86px;
        height: 64px;
    }

    .similar-grid {
        grid-template-columns: 1fr;
    }

    .similar-card img {
        height: 190px;
    }
}


.form-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    align-items:center;
}

.form-actions .btn-submit,
.form-actions .btn-card{
    flex:1;
    justify-content:center;
}

/* ==========================================================
   Admin catégories
   ========================================================== */

.categories-stats-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:15px;
    margin-bottom:20px;
}

.categories-stat-card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:16px;
    padding:18px;
}

.categories-stat-number{
    font-size:28px;
    font-weight:bold;
    color:var(--primary);
}

.categories-stat-label{
    color:var(--muted);
    font-size:14px;
}

.categories-list-box{
    background:none;
    border:0;
    padding:0;
}

.categories-list-header{
    display:flex;
    justify-content:space-between;
    gap:15px;
    align-items:center;
    margin-bottom:15px;
}

.categories-list-header h2{
    color:var(--primary-dark);
    font-size:22px;
}

.categories-search{
    margin-bottom:20px;
}

.categories-search input{
    width:100%;
    padding:14px;
    border:1px solid var(--border);
    border-radius:12px;
    font-size:16px;
}

.categories-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:18px;
}

.category-card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:18px;
    overflow:hidden;
}

.category-card-header{
    padding:18px;
    border-bottom:1px solid var(--border);
    display:flex;
    justify-content:space-between;
    gap:15px;
    align-items:flex-start;
}

.category-card-title{
    font-size:20px;
    font-weight:bold;
    color:var(--primary-dark);
}

.category-card-title i{
    margin-right:6px;
    color:var(--primary);
}

.category-card-meta{
    color:var(--muted);
    font-size:14px;
    margin-top:5px;
}

.category-badge{
    padding:6px 10px;
    border-radius:30px;
    font-size:13px;
    font-weight:bold;
    white-space:nowrap;
}

.category-badge-active{
    background:#e2f2ea;
    color:var(--primary-dark);
}

.category-badge-disabled{
    background:#f4e2df;
    color:var(--danger);
}

.subcategories-list{
    padding:15px 18px;
}

.subcategory-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:10px 0;
    border-bottom:1px solid #eeeeee;
}

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

.subcategory-name{
    font-weight:bold;
    color:var(--text);
}

.subcategory-name i{
    margin-right:6px;
    color:var(--primary);
}

.subcategory-code{
    color:var(--muted);
    font-size:14px;
}

.empty-subcategories{
    color:var(--muted);
    font-style:italic;
    padding:10px 0;
}

.category-card-actions{
    padding:15px 18px;
    background:#faf8f5;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.category-btn-mini,
.category-icon-btn{
    padding:9px 12px;
    border-radius:10px;
    border:1px solid var(--border);
    background:var(--card);
    color:var(--primary-dark);
    text-decoration:none;
    font-weight:bold;
    font-size:14px;
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.category-btn-mini:hover,
.category-icon-btn:hover{
    background:#f2eee9;
}

.category-btn-primary{
    background:var(--primary);
    color:#ffffff;
    border-color:var(--primary);
}

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

.category-icon-btn{
    width:38px;
    height:38px;
    justify-content:center;
    padding:0;
}

/* Modal catégorie */

.category-modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:999;
}

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

.category-modal{
    width:100%;
    max-width:520px;
    background:var(--card);
    border-radius:20px;
    border:1px solid var(--border);
    max-height:90vh;
    overflow:auto;
}

.category-modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
    padding:10px 20px;
    border-bottom:1px solid var(--border);
}

.category-modal-header h2{
    color:var(--primary-dark);
    font-size:18px;
}

.category-modal-close{
    width:38px;
    height:38px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#f2eee9;
    color:var(--text);
    text-decoration:none;
}

.category-modal-close:hover{
    background:var(--danger);
    color:#ffffff;
}

.category-form{
    padding:16px;
}

.category-type-choice{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    margin-bottom:18px;
}

.radio-card{
    border:1px solid var(--border);
    border-radius:14px;
    padding:14px;
    display:flex;
    gap:12px;
    cursor:pointer;
    background:#faf8f5;
}

.radio-card input{
    margin-top:5px;
}

.radio-card strong{
    display:block;
    color:var(--primary-dark);
}

.radio-card small{
    display:block;
    color:var(--muted);
    margin-top:3px;
}

.form-help{
    display:block;
    color:var(--muted);
    margin-top:5px;
    font-size:13px;
}

.checkbox-line{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:15px;
    font-weight:bold;
}

@media(max-width:900px){
    .categories-grid{
        grid-template-columns:1fr;
    }
}

@media(max-width:700px){
    .categories-stats-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .categories-list-header{
        flex-direction:column;
        align-items:stretch;
    }
}

@media(max-width:480px){
    .categories-stats-grid{
        grid-template-columns:1fr;
    }

    .category-card-header{
        flex-direction:column;
    }

    .subcategory-row{
        align-items:flex-start;
        flex-direction:column;
    }

    .category-modal-overlay{
        padding:10px;
        align-items:flex-start;
    }
}


.category-form .form-section{
    padding:16px;
    margin-bottom:12px;
}

.category-form .form-section label{
    margin-bottom:4px;
    font-size:15px;
}

.category-form .form-section input,
.category-form .form-section select{
    min-height:44px;
    margin-bottom:10px;
    padding:10px 12px;
    font-size:15px;
}

.detail-action-btn.success {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.detail-action-btn.success i {
    color: #fff;
}

.detail-action-btn.success:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

.categories-search-card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:14px;
    margin-bottom:18px;
}

.categories-search-card input{
    width:100%;
    min-height:46px;
    border:1px solid var(--border);
    border-radius:var(--radius-md);
    padding:11px 13px;
    font-size:16px;
    background:#fff;
}

.categories-compact-table td,
.categories-compact-table th{
    padding:10px 12px;
}

.category-code-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:52px;
    padding:4px 9px;
    border-radius:var(--radius-pill);
    background:var(--soft);
    color:var(--green-dark);
    font-weight:bold;
    font-size:13px;
}

.category-row i{
    color:var(--green);
    margin-right:6px;
}

.category-parent-name{
    color:var(--green-dark);
    font-weight:900;
}

.category-child-name{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding-left:22px;
    color:var(--text);
    font-weight:700;
}

.category-child-prefix{
    color:var(--muted);
    font-weight:bold;
}

.category-row:has(.category-parent-name){
    background:#faf8f6;
}

.upload-preview{
    margin-top:12px;
}

.upload-preview-grid{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
}

.upload-preview-item{
    position:relative;
    width:140px;
    height:140px;
    border-radius:12px;
    overflow:hidden;
    border:1px solid var(--border);
    background:var(--soft);
}

.upload-preview-item img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.upload-remove-btn{
    position:absolute;
    right:6px;
    bottom:6px;
    border:0;
    background:var(--danger);
    color:#fff;
    padding:6px 8px;
    border-radius:8px;
    font-size:12px;
    font-weight:bold;
    cursor:pointer;
}

.upload-remove-btn:hover{
    background:#8f2522;
}

.label-optional{
    color: var(--muted);
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 6px;
}

.label-required{
    color: var(--terracotta);
    font-weight: bold;
    margin-left: 4px;
}

.password-generator{
    display:flex;
    gap:10px;
    align-items:center;
}

.password-generator input{
    flex:1;
    margin-bottom:0;
}

.password-generator .btn-card{
    min-height:52px;
    padding:0 16px;
    border:0;
    cursor:pointer;
    white-space:nowrap;
}


.login-page{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    background:var(--bg);
    padding:30px;
}

.login-card{
    width:100%;
    max-width:430px;
}

.login-logo{
    text-align:center;
    margin-bottom:25px;
}

.login-logo-img{
    width:240px;
    max-width:100%;
    height:auto;
    display:block;
    margin:0 auto 20px;
}