/* ============================================================
   SUYKEN — Global Stylesheet
   ============================================================ */

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

/* ---- Base ---- */
html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #222;
    background: #f4f6f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main, .container { flex: 1; }

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header, .Barre {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    max-width: 1920px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
}

/* Logo */
.logo h1 { margin: 0; font-size: 1.7em; }
.logo a  { color: #0074d6; text-decoration: none; font-weight: 700; letter-spacing: -0.5px; }

/* Search bar */
.search-bar-header { flex: 1; max-width: 560px; margin: 0 12px; }

.search-form-header .search-input-group {
    display: flex;
    align-items: center;
    background: #f0f2f5;
    border-radius: 50px;
    padding: 6px 16px;
    transition: box-shadow 0.2s, background 0.2s;
}
.search-form-header .search-input-group:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px #0074d6;
}
.search-form-header input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 6px 10px;
    font-size: 0.93em;
    outline: none;
    font-family: inherit;
}
.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 4px 8px;
    font-size: 1em;
    transition: color 0.2s;
}
.search-btn:hover { color: #0074d6; }

/* Nav */
.nav { display: flex; align-items: center; gap: 6px; }

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #444;
    font-size: 11px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.nav-link i { font-size: 20px; }
.nav-link:hover { background: #f0f2f5; color: #0074d6; }

/* User menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}
.user-menu:hover { background: #f0f2f5; border-color: #dde2e8; }

.user-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-default {
    width: 100%; height: 100%;
    background: #0074d6; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.95em; border-radius: 50%;
}
.user-name { font-size: 13px; font-weight: 600; color: #333; }
.dropdown-arrow { font-size: 0.75em; color: #888; transition: transform 0.25s; }
.user-menu:hover .dropdown-arrow { transform: rotate(180deg); }

/* Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e4e8ef;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 1100;
    overflow: hidden;
}
.user-menu:hover .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: #333;
    text-decoration: none;
    font-size: 13.5px;
    border-bottom: 1px solid #f2f4f7;
    transition: background 0.15s;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #f5f7fb; color: #0074d6; }
.dropdown-item i { width: 18px; text-align: center; font-size: 15px; color: #888; }
.dropdown-divider { height: 1px; background: #e8ecf0; margin: 4px 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #1a1e2a;
    color: #c0c8d8;
    padding: 44px 0 20px;
    margin-top: auto;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}
.footer-section h3, .footer-section h4 { color: #fff; margin-bottom: 14px; font-size: 1em; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 8px; }
.footer-section a { color: #a0aab8; text-decoration: none; font-size: 0.9em; transition: color 0.2s; }
.footer-section a:hover { color: #5ba3f0; }
.footer-section p { font-size: 0.9em; color: #8a96a8; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid #2e3446; color: #5a6478; font-size: 0.85em; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    font-size: 0.92em;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s, transform 0.15s;
    white-space: nowrap;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: #0074d6; color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-success   { background: #27ae60; color: #fff; }
.btn-danger    { background: #e74c3c; color: #fff; }
.btn-warning   { background: #f39c12; color: #fff; }
.btn-outline   { background: transparent; border: 2px solid #0074d6; color: #0074d6; }
.btn-outline:hover { background: #0074d6; color: #fff; }
.btn-small     { padding: 6px 14px; font-size: 0.82em; border-radius: 7px; }
.btn-large     { padding: 14px 32px; font-size: 1.05em; border-radius: 14px; }
.btn-link      { background: none; color: #0074d6; padding: 4px 6px; font-weight: 500; }
.btn-link:hover { text-decoration: underline; opacity: 1; transform: none; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 600;
}
.badge-success   { background: #d4edda; color: #155724; }
.badge-danger    { background: #f8d7da; color: #721c24; }
.badge-primary   { background: #cce5ff; color: #004085; }
.badge-secondary { background: #e2e3e5; color: #383d41; }
.badge-warning   { background: #fff3cd; color: #856404; }
.badge-info      { background: #d1ecf1; color: #0c5460; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 13px 18px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.93em;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-error, .alert-danger { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9em; color: #444; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid #dde2ea;
    border-radius: 10px;
    font-size: 0.95em;
    font-family: inherit;
    background: #f8f9fb;
    color: #222;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0074d6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,116,214,0.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border-left: 4px solid #0074d6;
}
.stat-icon { font-size: 2em; color: #0074d6; margin-bottom: 8px; }
.stat-number { font-size: 2.1em; font-weight: 800; color: #1a1e2a; line-height: 1; margin-bottom: 6px; }
.stat-label  { font-size: 0.85em; color: #777; font-weight: 500; }

/* ============================================================
   HERO SECTION (index)
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #0052a3 0%, #0074d6 50%, #3b9eff 100%);
    color: #fff;
    padding: 64px 24px;
    text-align: center;
    margin-bottom: 48px;
}
.hero-section h2 { font-size: 2.4em; font-weight: 800; margin-bottom: 12px; }
.hero-section p  { font-size: 1.1em; opacity: 0.88; margin-bottom: 28px; }

.search-box-hero {
    display: flex;
    max-width: 580px;
    margin: 0 auto 24px;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.search-box-hero input {
    flex: 1;
    border: none;
    padding: 14px 22px;
    font-size: 1em;
    outline: none;
    font-family: inherit;
    color: #222;
}
.search-box-hero button {
    background: #0052a3;
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    font-family: inherit;
}
.search-box-hero button:hover { background: #003e80; }

.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cta-btn { padding: 12px 26px; border-radius: 50px; font-weight: 600; text-decoration: none; font-size: 0.95em; transition: all 0.2s; }
.cta-btn-primary  { background: #fff; color: #0074d6; }
.cta-btn-primary:hover { background: #e8f1fb; }
.cta-btn-secondary { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.6); }
.cta-btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* ============================================================
   CATEGORIES (index)
   ============================================================ */
.categories-section { margin-bottom: 48px; }
.section-title { font-size: 1.5em; font-weight: 700; color: #1a1e2a; margin-bottom: 24px; }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: #fff;
    border-radius: 14px;
    text-decoration: none;
    color: #333;
    font-size: 0.88em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1.5px solid transparent;
    transition: all 0.22s;
}
.category-card i { font-size: 1.8em; color: #0074d6; }
.cat-count { font-size: 0.78em; color: #999; font-weight: 400; }
.category-card:hover { border-color: #0074d6; transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,116,214,0.15); }

/* ============================================================
   ADS GRID
   ============================================================ */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    margin-bottom: 48px;
}
.ad-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.22s, box-shadow 0.22s;
    border: 1.5px solid #edf0f5;
}
.ad-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.13); }

.ad-image { height: 190px; overflow: hidden; background: #f0f2f5; }
.ad-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.ad-card:hover .ad-image img { transform: scale(1.04); }

.ad-content { padding: 16px; }
.ad-content h4 { font-size: 0.97em; color: #1a1e2a; margin-bottom: 8px; font-weight: 600; line-height: 1.4; }
.ad-price    { font-size: 1.2em; font-weight: 800; color: #0074d6; margin-bottom: 8px; }
.ad-location, .ad-date { font-size: 0.83em; color: #888; margin-bottom: 4px; }
.ad-location i, .ad-date i { color: #bbb; margin-right: 4px; }

/* Image placeholder */
.img-placeholder {
    width: 100%; height: 100%;
    min-height: 160px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px;
    background: #f0f2f5; color: #c0c4cc;
    border-radius: 8px;
}
.img-placeholder i { font-size: 2.4em; }
.img-placeholder span { font-size: 0.82em; color: #b0b5bd; }
.img-placeholder--large { height: 400px; border-radius: 10px; }
.img-placeholder--large i { font-size: 3.5em; }

/* ============================================================
   ANNONCE DETAIL
   ============================================================ */
.breadcrumb { margin-bottom: 18px; font-size: 0.88em; color: #888; }
.breadcrumb a { color: #0074d6; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 8px; }

.annonce-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 36px;
    margin-bottom: 48px;
    align-items: start;
}

.annonce-image { margin-bottom: 16px; border-radius: 14px; overflow: hidden; }
.annonce-image img { width: 100%; height: 420px; object-fit: cover; display: block; }

.annonce-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 18px;
    background: #f8f9fb;
    border-radius: 10px;
    margin: 16px 0;
}
.meta-item { display: flex; align-items: center; gap: 7px; color: #666; font-size: 0.9em; }
.meta-item i { color: #0074d6; }

.annonce-description { margin-top: 24px; }
.annonce-description h3 { font-size: 1.05em; font-weight: 700; color: #1a1e2a; margin-bottom: 12px; }
.annonce-description p { color: #555; line-height: 1.75; white-space: pre-line; }

/* Price box */
.price-box {
    background: #fff;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.09);
    text-align: center;
    margin-bottom: 20px;
    border: 1.5px solid #edf0f5;
}
.price { font-size: 2.4em; font-weight: 800; color: #0074d6; margin-bottom: 18px; }

/* Seller info */
.seller-info {
    background: #fff;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.09);
    margin-bottom: 18px;
    border: 1.5px solid #edf0f5;
}
.seller-info h3 { font-size: 1em; font-weight: 700; margin-bottom: 14px; color: #1a1e2a; }
.seller-details { display: flex; flex-direction: column; gap: 8px; }
.seller-name, .seller-location, .seller-member { display: flex; align-items: center; gap: 8px; color: #666; font-size: 0.9em; }
.seller-name i, .seller-location i, .seller-member i { color: #0074d6; width: 16px; text-align: center; }

.contact-actions { margin-top: 16px; }

.message-form {
    background: #fff;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.09);
    border: 1.5px solid #edf0f5;
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-header {
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px;
    text-align: center;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    margin-bottom: 28px;
}
.profile-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0074d6;
    margin-bottom: 14px;
}

.profile-content { display: flex; flex-direction: column; gap: 24px; }

.profile-section {
    background: #fff;
    padding: 28px 30px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.profile-section h3 {
    font-size: 1.05em;
    font-weight: 700;
    color: #1a1e2a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #edf0f5;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* My ads */
.my-ads-grid { display: flex; flex-direction: column; gap: 16px; }
.my-ad-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    padding: 18px;
    border: 1.5px solid #edf0f5;
    border-radius: 12px;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.my-ad-card:hover { border-color: #0074d6; box-shadow: 0 4px 16px rgba(0,116,214,0.1); }
.my-ad-card .ad-image { height: 130px; border-radius: 8px; }

.ad-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.status-active   { color: #27ae60; font-weight: 700; }
.status-inactive { color: #95a5a6; font-weight: 700; }
.status-vendu, .status-vendue { color: #e74c3c; font-weight: 700; }

.no-ads { text-align: center; padding: 48px 20px; color: #999; }
.no-ads i { font-size: 3.5em; color: #dde2ea; display: block; margin-bottom: 16px; }

/* Auth forms (connexion, inscription) */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 78vh;
    padding: 48px 20px;
}
.auth-form {
    background: #fff;
    padding: 44px 40px;
    border-radius: 22px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.10);
    width: 100%;
    max-width: 480px;
}
.auth-form h2 { text-align: center; font-size: 1.55em; margin-bottom: 6px; color: #1a1e2a; }
.auth-form > p { text-align: center; color: #888; margin-bottom: 28px; font-size: 0.93em; }
.edit-form { max-width: 600px; }

/* ============================================================
   MESSAGERIE
   ============================================================ */
.messagerie-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: 78vh;
    min-height: 500px;
}

.conversations-list {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1.5px solid #edf0f5;
}
.conversations-list h3 {
    padding: 16px 20px;
    font-size: 0.97em;
    font-weight: 700;
    background: #f8f9fb;
    border-bottom: 1px solid #edf0f5;
    margin: 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid #f4f6f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.18s;
    gap: 12px;
}
.conversation-item:hover, .conversation-item.active { background: #f0f6ff; }

.conversation-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #0074d6;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 1em;
}
.conversation-info { flex: 1; min-width: 0; }
.conversation-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.conversation-header h4 { font-size: 0.9em; font-weight: 700; color: #1a1e2a; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-date { font-size: 0.75em; color: #aaa; flex-shrink: 0; }
.conversation-annonce { font-size: 0.82em; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.unread-badge {
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 20px; height: 20px;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 0.72em;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   ANNONCES LIST (annonces.php)
   ============================================================ */
.filters-bar {
    background: #fff;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filters-bar .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-header {
    text-align: center;
    padding: 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 30px;
}
.admin-header h1 { font-size: 1.7em; color: #1a1e2a; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin-bottom: 30px; }
.admin-stats .stat-card { border-left: 4px solid #0074d6; }

.admin-section {
    background: #fff;
    padding: 28px 30px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 26px;
}
.admin-section h3 {
    font-size: 1.05em;
    font-weight: 700;
    color: #1a1e2a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #edf0f5;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f0f3f8; }
.admin-table th { background: #f8f9fb; font-weight: 700; color: #555; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.3px; }
.admin-table tr:hover td { background: #fafbff; }
.admin-table .actions { white-space: nowrap; }

.admin-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.tool-card {
    background: #f8f9fb;
    border-radius: 12px;
    padding: 22px 20px;
    text-align: center;
    border: 1.5px solid #edf0f5;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tool-card:hover { border-color: #0074d6; box-shadow: 0 4px 16px rgba(0,116,214,0.1); }
.tool-card h4 { color: #0074d6; margin-bottom: 8px; font-size: 1em; }
.tool-card p  { color: #777; font-size: 0.88em; margin-bottom: 14px; line-height: 1.5; }

/* User details in admin */
.user-details-row { background: #f8f9fb; }
.user-details-panel { padding: 20px; border-left: 3px solid #0074d6; }
.details-section { margin-bottom: 28px; }
.details-section h4 { color: #333; margin-bottom: 12px; font-size: 0.95em; font-weight: 700; }
.details-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.details-table th { background: #edf0f5; padding: 8px 10px; text-align: left; font-size: 0.83em; font-weight: 700; color: #555; }
.details-table td { padding: 8px 10px; border-bottom: 1px solid #f0f3f8; font-size: 0.83em; color: #444; }

/* Broadcast */
.broadcast-wrap { background: #f8f9fc; border: 1.5px solid #e0e6f0; border-radius: 14px; padding: 22px 24px; }
.broadcast-info { margin-bottom: 16px; }
.broadcast-info p { margin: 8px 0 0; color: #555; font-size: 0.92em; line-height: 1.55; }
.team-badge { display: inline-flex; align-items: center; gap: 6px; background: #0074d6; color: #fff; border-radius: 20px; padding: 4px 14px; font-size: 0.85em; font-weight: 700; }
.broadcast-textarea { width: 100%; min-height: 110px; padding: 12px 16px; border: 1.5px solid #dde2ea; border-radius: 10px; font-size: 0.93em; font-family: inherit; background: #fff; resize: vertical; box-sizing: border-box; transition: border-color 0.2s; }
.broadcast-textarea:focus { outline: none; border-color: #0074d6; box-shadow: 0 0 0 3px rgba(0,116,214,0.10); }
.btn-broadcast { background: #0074d6; color: #fff; padding: 10px 22px; border-radius: 8px; border: none; font-size: 0.92em; font-weight: 700; cursor: pointer; transition: background 0.2s; font-family: inherit; }
.btn-broadcast:hover { background: #005bb5; }
.bc-img-label { display: block; font-size: 0.87em; color: #555; margin-bottom: 8px; font-weight: 600; }
.bc-img-row { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   RAPPORTS D'ACTIVITÉ
   ============================================================ */
.rp-section {
    background: #fff;
    border-radius: 20px;
    padding: 32px 30px;
    margin-bottom: 26px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

/* Header */
.rp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.rp-title {
    font-size: 1.25em;
    font-weight: 800;
    color: #1a1e2a;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.rp-title i { color: #0074d6; }
.rp-subtitle { font-size: 0.85em; color: #999; margin: 0; }
.rp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Period tabs */
.rp-tabs { display: flex; background: #f0f3f8; border-radius: 10px; padding: 4px; gap: 2px; }
.rp-tab { padding: 6px 16px; border-radius: 8px; font-size: 0.83em; font-weight: 700; text-decoration: none; color: #777; transition: all 0.18s; }
.rp-tab:hover { color: #0074d6; }
.rp-tab--active { background: #fff; color: #0074d6; box-shadow: 0 1px 6px rgba(0,0,0,0.10); }

/* Export button */
.rp-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 10px;
    background: #f0faf5;
    color: #27ae60;
    font-size: 0.85em;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid #c3e6d0;
    transition: all 0.18s;
}
.rp-export-btn:hover { background: #27ae60; color: #fff; border-color: #27ae60; }

/* KPI cards */
.rp-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.rp-kpi {
    border-radius: 16px;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}
.rp-kpi::before {
    content: '';
    position: absolute;
    bottom: -18px;
    right: -18px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.12;
    background: currentColor;
}
.rp-kpi--blue   { background: linear-gradient(135deg, #e8f2ff, #d0e6ff); color: #0074d6; }
.rp-kpi--green  { background: linear-gradient(135deg, #e6faf2, #c8f0df); color: #00b894; }
.rp-kpi--purple { background: linear-gradient(135deg, #f0ebff, #ddd0ff); color: #6c5ce7; }
.rp-kpi--orange { background: linear-gradient(135deg, #fff5e6, #ffe0b0); color: #e67e22; }
.rp-kpi-left { display: flex; flex-direction: column; gap: 2px; }
.rp-kpi-label  { font-size: 0.78em; font-weight: 700; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.3px; color: #333; }
.rp-kpi-value  { font-size: 2.4em; font-weight: 900; line-height: 1; color: #1a1e2a; }
.rp-kpi-period { font-size: 0.75em; color: #999; }
.rp-kpi-icon   { font-size: 2em; opacity: 0.5; flex-shrink: 0; }

/* Chart card */
.rp-chart-card {
    background: #f8f9fb;
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    border: 1.5px solid #edf0f5;
}
.rp-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.rp-chart-title { font-size: 0.92em; font-weight: 700; color: #1a1e2a; }
.rp-legend { display: flex; gap: 16px; }
.rp-leg { display: flex; align-items: center; gap: 6px; font-size: 0.8em; font-weight: 600; color: #555; }
.rp-leg span { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.rp-leg--blue span  { background: #0074d6; }
.rp-leg--green span { background: #00b894; }

/* Bottom grid */
.rp-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rp-card {
    background: #f8f9fb;
    border-radius: 16px;
    padding: 20px 22px;
    border: 1.5px solid #edf0f5;
}
.rp-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88em;
    font-weight: 800;
    color: #1a1e2a;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rp-card-header i { color: #0074d6; font-size: 1.05em; }
.rp-empty { color: #bbb; font-size: 0.88em; text-align: center; padding: 20px 0; }

/* Category rows */
.rp-cat-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rp-cat-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.9em; flex-shrink: 0; }
.rp-cat-info { flex: 1; min-width: 0; }
.rp-cat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.rp-cat-name { font-size: 0.85em; font-weight: 600; color: #333; }
.rp-cat-nb   { font-size: 0.78em; color: #999; }
.rp-cat-bar  { height: 5px; background: #e8ecf0; border-radius: 3px; overflow: hidden; }
.rp-cat-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(.4,0,.2,1); }

/* Top viewed rows */
.rp-topview-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid #edf0f5; }
.rp-topview-row:last-child { border-bottom: none; }
.rp-topview-rank { width: 26px; height: 26px; border-radius: 8px; background: #edf3ff; color: #0074d6; font-size: 0.82em; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rp-topview-info { flex: 1; min-width: 0; }
.rp-topview-title { display: block; font-size: 0.87em; font-weight: 600; color: #1a1e2a; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.rp-topview-title:hover { color: #0074d6; }
.rp-topview-meta { font-size: 0.76em; color: #aaa; }
.rp-topview-views { text-align: right; flex-shrink: 0; }
.rp-views-num   { display: block; font-size: 1.1em; font-weight: 800; color: #1a1e2a; line-height: 1; }
.rp-views-label { font-size: 0.7em; color: #bbb; font-weight: 500; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-muted  { color: #888; font-size: 0.88em; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* current-image in edit form */
.current-image {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 10px; padding: 10px 14px;
    background: #f0f6ff; border-radius: 10px; border: 1.5px solid #d0e4f7;
}
.current-image img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.current-image span { font-size: 0.87em; color: #555; }

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

/* ---- Touch targets ---- */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .btn-small { min-height: 44px; }
    .form-group input,
    .form-group select,
    .form-group textarea { font-size: 16px; /* prevent iOS zoom */ }
}

/* ---- Tablet landscape ---- */
@media (max-width: 1024px) {
    .annonce-content { grid-template-columns: 1fr; }
    .messagerie-content { grid-template-columns: 1fr; height: auto; }
    .ads-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* ---- Tablet portrait ---- */
@media (max-width: 768px) {
    /* Header */
    .header .container { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
    .search-bar-header { order: 3; width: 100%; margin: 0; max-width: none; }
    .nav { gap: 4px; }
    .nav-text, .user-name { display: none; }
    .nav-link { padding: 8px; }
    .user-menu { padding: 5px; }

    /* Global container */
    .container { padding: 0 14px; }

    /* Hero */
    .hero-section h2 { font-size: 1.7em; }
    .hero-section { padding: 48px 16px; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; }
    .auth-form { padding: 28px 20px; }

    /* Cards */
    .my-ad-card { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .ad-actions { flex-wrap: wrap; gap: 8px; }

    /* Admin */
    .admin-section { padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-tools { grid-template-columns: repeat(2, 1fr); }

    /* Reports */
    .report-bottom-grid { grid-template-columns: 1fr; }
    .rp-kpis { grid-template-columns: repeat(2, 1fr); }
    .rp-section { padding: 20px 16px; }

    /* Pagination */
    .pagination { gap: 4px; }
    .pagination a, .pagination span { padding: 8px 12px; font-size: 0.88em; }

    /* Footer */
    .footer-content { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    /* Reports */
    .rp-kpis  { grid-template-columns: 1fr; }
    .rp-bottom { grid-template-columns: 1fr; }

    /* Header — compact single row */
    .header .container { padding: 8px 12px; }
    .logo h1 { font-size: 1.4em; }

    /* Buttons */
    .btn-large { padding: 12px 24px; font-size: 0.97em; }

    /* Admin stats 1 col */
    .stats-grid { grid-template-columns: 1fr; }
    .admin-tools { grid-template-columns: 1fr; }

    /* Footer */
    .footer-content { grid-template-columns: 1fr; }

    /* Modals */
    .modal-box { margin: 12px; padding: 24px 16px; }
}

/* ---- Small phones ---- */
@media (max-width: 480px) {
    .hero-section { padding: 40px 16px; }
    .hero-section h2 { font-size: 1.4em; }
    .hero-section p { font-size: 0.95em; }

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

    /* Card images shorter on small phones */
    .ad-image { height: 170px; }

    /* Message bubbles fill more width */
    .bubble-row { max-width: 92%; }

    /* Annonce contact button full width */
    .btn-contact { width: 100%; justify-content: center; }
}
