/* ═══════════════════════════════════════════════════════
   Petites Annonces — Stylesheet
   DM Sans + Playfair Display · Light/Dark · Responsive
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─────────────────────────── */
:root {
    /* Brand */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --featured-border: #f59e0b;

    /* Semantic */
    --success: #16a34a;
    --success-hover: #15803d;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --info: #0ea5e9;

    /* Surfaces */
    --bg: #f5f5f0;
    --bg-card: #ffffff;
    --bg-alt: #f0ede6;
    --bg-hero: linear-gradient(135deg, #1e293b 0%, #334155 100%);

    /* Text */
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Borders */
    --border: #e2e0d9;
    --border-focus: #2563eb;

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

    /* Stat card palette */
    --c1: #2563eb;
    --c2: #7c3aed;
    --c3: #f59e0b;
    --c4: #0ea5e9;
    --c5: #16a34a;
    --c6: #ec4899;
}

/* ─── Dark Mode ─────────────────────────────────────── */
:root.dark {
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    --featured-border: #fbbf24;

    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-alt: #1a2332;
    --bg-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;

    --border: #334155;
    --border-focus: #60a5fa;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--primary); }

/* ─── Animations ────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes staggerIn {
    from { opacity: 0; transform: scale(.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.fade-in { animation: fadeInUp .5s ease both; }
.stagger { animation: staggerIn .4s ease both; }

/* ─── Header ────────────────────────────────────────── */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ─── Logo ──────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: inherit !important;
}
.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
.logo-sub {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Buttons ───────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-alt); }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; padding: 9px 12px; }
.btn-ghost:hover { color: var(--primary); background: var(--bg-alt); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: var(--success-hover); border-color: var(--success-hover); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: var(--warning-hover); border-color: var(--warning-hover); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }

.hide-mobile { }

/* ─── Main Container ────────────────────────────────── */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ─── Hero ──────────────────────────────────────────── */
.hero {
    background: var(--bg-hero);
    color: #fff;
    text-align: center;
    padding: 56px 24px 48px;
}
.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.hero p {
    font-size: .95rem;
    opacity: .8;
    max-width: 540px;
    margin: 0 auto 28px;
}

/* ─── Search Bar ────────────────────────────────────── */
.search-bar {
    display: flex;
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}
:root.dark .search-bar { background: var(--bg-card); }
.search-bar input[type="text"],
.search-bar select {
    border: none;
    padding: 14px 16px;
    font-family: inherit;
    font-size: .92rem;
    background: transparent;
    color: var(--text);
    min-width: 0;
}
.search-bar input[type="text"] { flex: 1; }
.search-bar select { border-left: 1px solid var(--border); max-width: 180px; }
.search-bar .btn { border-radius: 0; padding: 14px 24px; flex-shrink: 0; }

/* ─── Section Title ─────────────────────────────────── */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i { font-size: 1rem; color: var(--primary); }

/* ─── Categories Grid ───────────────────────────────── */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 40px;
}
.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    text-align: center;
    transition: all .25s;
    cursor: pointer;
}
.cat-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.cat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 auto 10px;
}
.cat-card:hover .cat-card-icon { background: var(--primary); color: #fff; }
.cat-card-name { font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.cat-card-count { font-size: .76rem; color: var(--text-muted); }

/* ─── Ads Grid ──────────────────────────────────────── */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.ad-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all .25s;
    display: flex;
    flex-direction: column;
}
.ad-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--primary);
}
.ad-card.featured {
    border-color: var(--featured-border);
    box-shadow: 0 0 0 1px var(--featured-border);
}
.ad-card-img {
    height: 180px;
    overflow: hidden;
    background: var(--bg-alt);
    position: relative;
}
.ad-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ad-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.ad-card-title {
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ad-card-price {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 8px;
}
.ad-card-meta {
    font-size: .78rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}
.ad-card-meta i { margin-right: 3px; }
.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ─── Breadcrumb ────────────────────────────────────── */
.breadcrumb {
    font-size: .84rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumb .sep { color: var(--text-light); }
.breadcrumb .current { font-weight: 600; }

/* ─── Back Link ─────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    transition: color .2s;
}
.back-link:hover { color: var(--primary); }

/* ─── Filter Bar ────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.filter-bar select {
    font-family: inherit;
    font-size: .88rem;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-alt);
    color: var(--text);
    cursor: pointer;
}
.results-count {
    margin-left: auto;
    font-size: .84rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Pagination ────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
}
.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-weight: 500;
    font-size: .88rem;
    text-decoration: none;
    transition: all .2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Empty State ───────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; opacity: .4; }
.empty-state h3 { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: .88rem; }

/* ─── Ad Detail ─────────────────────────────────────── */
.ad-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 20px;
}
.ad-detail-gallery {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-alt);
    aspect-ratio: 4/3;
    max-height: 420px;
}
.ad-detail-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    box-shadow: var(--shadow-sm);
    transition: all .2s;
    color: #333;
}
:root.dark .gallery-nav { background: rgba(30,41,59,.9); color: #e2e8f0; }
.gallery-nav:hover { background: var(--primary); color: #fff; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumbs img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 2px solid var(--border);
    cursor: pointer;
    opacity: .6;
    transition: all .2s;
    flex-shrink: 0;
}
.gallery-thumbs img.active,
.gallery-thumbs img:hover { opacity: 1; border-color: var(--primary); }

.ad-detail-body { }
.ad-detail-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.ad-detail-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}
.ad-detail-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}
.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    color: var(--text-muted);
}
.info-item i { color: var(--primary); width: 16px; text-align: center; }
.ad-detail-desc {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 24px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ─── Seller Card ───────────────────────────────────── */
.seller-card {
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 8px;
}
.seller-card h4 {
    font-size: .95rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.seller-info { display: flex; align-items: center; gap: 14px; }
.seller-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ─── Forms ─────────────────────────────────────────── */
.form-page {
    max-width: 600px;
    margin: 0 auto;
}
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
}
.form-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 500;
    font-size: .88rem;
    margin-bottom: 6px;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: .92rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
:root.dark .form-control:focus { box-shadow: 0 0 0 3px rgba(96,165,250,.15); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.required { color: var(--danger); }

/* ─── Image Preview ─────────────────────────────────── */
.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    border: 1px solid var(--border);
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.remove-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    transition: background .2s;
}
.remove-img:hover { background: var(--danger-hover); }

/* ─── Payment / Registration Step ───────────────────── */
.payment-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-card);
    transition: all .3s;
}
.step-dot.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.step-dot.done {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}
.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    transition: background .3s;
}
.step-line.done { background: var(--success); }

.payment-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    margin: 18px 0;
}
.payment-box.highlight {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(245,158,11,.06) 0%, rgba(245,158,11,.01) 100%);
}
:root.dark .payment-box.highlight {
    background: linear-gradient(135deg, rgba(251,191,36,.08) 0%, rgba(251,191,36,.02) 100%);
}
.payment-label { font-size: .88rem; color: var(--text-muted); margin-bottom: 6px; }
.payment-amount {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.payment-amount .currency { font-size: 1.2rem; vertical-align: super; margin-right: 2px; }
.payment-paypal {
    font-size: .82rem;
    color: #003087;
    margin-top: 8px;
    font-weight: 600;
}
:root.dark .payment-paypal { color: #5b9cf6; }
.payment-divider {
    text-align: center;
    position: relative;
    margin: 18px 0;
    font-size: .82rem;
    color: var(--text-light);
}
.payment-divider::before,
.payment-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 20px);
    height: 1px;
    background: var(--border);
}
.payment-divider::before { left: 0; }
.payment-divider::after  { right: 0; }

/* ─── Account ───────────────────────────────────────── */
.account-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    margin-top: 20px;
}
.account-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    height: fit-content;
}
.account-content { min-width: 0; }
.user-info { text-align: center; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 auto 10px;
}
.user-name { font-weight: 700; font-size: 1.05rem; }
.user-type { font-size: .82rem; color: var(--text-muted); }
.account-menu { list-style: none; }
.account-menu li {
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all .2s;
    font-size: .9rem;
}
.account-menu li:hover { background: var(--bg-alt); }
.account-menu li.active { background: var(--bg-alt); color: var(--primary); font-weight: 600; }
.account-menu li.active a { color: var(--primary) !important; }

/* ─── Status Badge ──────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge.pending  { background: rgba(245,158,11,.12); color: #b45309; }
.status-badge.featured { background: rgba(245,158,11,.12); color: #b45309; }
.status-badge.active   { background: rgba(22,163,74,.1);   color: #15803d; }
.status-badge.blocked  { background: rgba(220,38,38,.1);   color: #dc2626; }
:root.dark .status-badge.pending  { background: rgba(251,191,36,.15); color: #fbbf24; }
:root.dark .status-badge.featured { background: rgba(251,191,36,.15); color: #fbbf24; }
:root.dark .status-badge.active   { background: rgba(34,197,94,.12);  color: #4ade80; }
:root.dark .status-badge.blocked  { background: rgba(248,113,113,.12); color: #f87171; }

/* ─── Toast Notifications ───────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideDown .4s ease;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border-left: 4px solid var(--info);
    box-shadow: var(--shadow-lg);
    font-size: .9rem;
    color: var(--text);
    transition: opacity .4s;
}
.toast.success { border-left-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.error i   { color: var(--danger); }
.toast.info    { border-left-color: var(--info); }
.toast.info i    { color: var(--info); }

/* ═══════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════ */

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-badge {
    font-family: 'DM Sans', sans-serif;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ─── Admin Tabs ────────────────────────────────────── */
.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 0;
}
.admin-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all .2s;
}
.admin-tab:hover { color: var(--primary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count {
    background: var(--danger);
    color: #fff;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: .7rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

/* ─── Admin Card ────────────────────────────────────── */
.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.admin-card h3 {
    font-size: 1rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Admin Table ───────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-alt); }
.admin-table tr:last-child td { border-bottom: none; }
.cell-title { display: block; font-weight: 600; }
.cell-sub   { display: block; font-size: .76rem; color: var(--text-muted); }
.admin-actions { display: flex; gap: 6px; }

/* ─── Stat Grid ─────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.stat-card.c1::before { background: var(--c1); }
.stat-card.c2::before { background: var(--c2); }
.stat-card.c3::before { background: var(--c3); }
.stat-card.c4::before { background: var(--c4); }
.stat-card.c5::before { background: var(--c5); }
.stat-card.c6::before { background: var(--c6); }
.stat-icon { font-size: 1.4rem; margin-bottom: 8px; }
.stat-card.c1 .stat-icon { color: var(--c1); }
.stat-card.c2 .stat-icon { color: var(--c2); }
.stat-card.c3 .stat-icon { color: var(--c3); }
.stat-card.c4 .stat-icon { color: var(--c4); }
.stat-card.c5 .stat-icon { color: var(--c5); }
.stat-card.c6 .stat-icon { color: var(--c6); }
.stat-value { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Chart Bars ────────────────────────────────────── */
.chart-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.chart-bar-label {
    width: 120px;
    font-size: .82rem;
    font-weight: 500;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chart-bar-track {
    flex: 1;
    height: 26px;
    background: var(--bg-alt);
    border-radius: var(--radius-xs);
    overflow: hidden;
}
.chart-bar-fill {
    height: 100%;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: .76rem;
    font-weight: 700;
    color: #fff;
    min-width: fit-content;
    transition: width .6s ease;
}
.chart-bar-fill.c1 { background: var(--c1); }
.chart-bar-fill.c2 { background: var(--c2); }
.chart-bar-fill.c3 { background: var(--c3); }
.chart-bar-fill.c4 { background: var(--c4); }
.chart-bar-fill.c5 { background: var(--c5); }
.chart-bar-fill.c6 { background: var(--c6); }

/* ─── Settings ──────────────────────────────────────── */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    gap: 14px;
}
.settings-row:last-child { border-bottom: none; }
.label-area { flex: 1; }
.label-area strong { display: block; font-size: .9rem; }
.label-area span  { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Toggle Switch ─────────────────────────────────── */
.toggle-switch {
    width: 48px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--border);
    cursor: pointer;
    position: relative;
    transition: background .3s;
    flex-shrink: 0;
    padding: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .3s;
}
.toggle-switch.on {
    background: var(--primary);
}
.toggle-switch.on::after {
    transform: translateX(20px);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .ad-detail {
        grid-template-columns: 1fr;
    }
    .account-layout {
        grid-template-columns: 1fr;
    }
    .account-sidebar {
        order: -1;
    }
}

@media (max-width: 640px) {
    .hide-mobile { display: none !important; }

    .header-inner { padding: 10px 14px; }
    .header-actions { gap: 4px; }
    .header-actions .btn { padding: 8px 10px; font-size: .82rem; }

    .hero { padding: 36px 16px 32px; }
    .hero h1 { font-size: 1.5rem; }
    .hero p  { font-size: .85rem; }

    .search-bar {
        flex-direction: column;
        border-radius: var(--radius-sm);
    }
    .search-bar select {
        border-left: none;
        border-top: 1px solid var(--border);
        max-width: none;
    }
    .search-bar .btn { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

    .main { padding: 16px 14px 32px; }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .cat-card { padding: 14px 8px; }
    .cat-card-icon { width: 40px; height: 40px; font-size: 1rem; }
    .cat-card-name { font-size: .78rem; }

    .ads-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .ad-card-img { height: 130px; }
    .ad-card-body { padding: 10px; }
    .ad-card-title { font-size: .82rem; }
    .ad-card-price { font-size: .95rem; }
    .ad-card-meta  { font-size: .7rem; flex-direction: column; gap: 2px; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar select { width: 100%; }
    .results-count { margin-left: 0; text-align: center; }

    .form-card { padding: 20px 16px; }
    .form-row  { grid-template-columns: 1fr; gap: 0; }

    .ad-detail-title { font-size: 1.25rem; }
    .ad-detail-price { font-size: 1.2rem; }
    .ad-detail-info  { grid-template-columns: 1fr; }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.4rem; }

    .admin-tabs { gap: 0; }
    .admin-tab  { padding: 10px 12px; font-size: .82rem; }

    .admin-card { padding: 16px; }
    .admin-table { font-size: .78rem; }
    .admin-table th,
    .admin-table td { padding: 8px; }

    .chart-bar-label { width: 80px; font-size: .74rem; }

    .section-title { font-size: 1.1rem; }
}

@media (max-width: 420px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ads-grid {
        grid-template-columns: 1fr;
    }
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    .logo-text { font-size: 1rem; }
    .logo-sub  { font-size: .65rem; }
    .logo-icon { width: 36px; height: 36px; font-size: .95rem; }
}

/* ─── Print ─────────────────────────────────────────── */
@media print {
    .header, .toast-container, .admin-tabs, .btn { display: none !important; }
    body { background: #fff; color: #000; }
}
