:root {
    --primary:      #1E40AF;
    --primary-dark: #1E3A8A;
    --secondary:    #F59E0B;
    --success:      #10B981;
    --danger:       #EF4444;
    --warning:      #F59E0B;
    --bg-light:     #F8FAFC;
    --bg-dark:      #0F172A;
    --text-primary: #1E293B;
    --text-muted:   #94A3B8;
    --border:       #E2E8F0;
    --radius:       8px;
    --shadow:       0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg:    0 10px 15px rgba(0,0,0,0.1);
    --transition:   all 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: opacity 0.4s ease;
}
#preloader.fade-out { opacity: 0; pointer-events: none; }
.preloader-inner { text-align: center; }
.preloader-brand {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    display: block;
    margin-bottom: 16px;
}
.preloader-bar {
    width: 120px;
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}
.preloader-bar-fill {
    width: 40%;
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    animation: preloaderSlide 1.2s ease-in-out infinite;
}
@keyframes preloaderSlide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(200%); }
    100% { transform: translateX(-100%); }
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
.skeleton-img   { height: 180px; width: 100%; }
.skeleton-title { height: 16px; width: 70%; margin: 12px 0 8px; }
.skeleton-price { height: 20px; width: 40%; }
.skeleton-text  { height: 12px; width: 90%; margin-top: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-spinner .spin { animation: spin 0.8s linear infinite; display: inline-block; }
.hidden { display: none; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 14px; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,64,175,0.1); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* Topbar */
.topbar { background: var(--bg-dark); color: var(--text-muted); font-size: 12px; padding: 6px 0; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; }
.topbar-left { display: flex; align-items: center; gap: 20px; }
.topbar-left span { display: flex; align-items: center; gap: 6px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right a { color: var(--text-muted); font-size: 14px; }
.topbar-right a:hover { color: white; }

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.navbar-brand { font-size: 18px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.navbar-brand:hover { color: var(--primary-dark); }
.navbar-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text-primary); cursor: pointer; padding: 4px; }

/* Nav links */
.navbar-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.nav-link:hover { color: var(--primary); background: #EFF6FF; }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { white-space: nowrap; }
.nav-dropdown-toggle .bi-chevron-down { font-size: 10px; transition: transform 0.2s; }
.nav-dropdown.active .nav-dropdown-toggle .bi-chevron-down { transform: rotate(180deg); }
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 220px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 200;
}
.nav-dropdown.active .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown-right { left: auto; right: 0; }
.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}
.nav-dropdown-menu a:hover { background: #EFF6FF; color: var(--primary); }
.nav-dropdown-menu a i { width: 16px; text-align: center; color: var(--text-muted); font-size: 15px; }
.nav-dropdown-menu a:hover i { color: var(--primary); }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.nav-dropdown-danger { color: var(--danger) !important; }
.nav-dropdown-danger:hover { background: #FEF2F2 !important; color: var(--danger) !important; }
.nav-dropdown-danger i { color: var(--danger) !important; }

/* Navbar actions */
.navbar-actions { display: flex; align-items: center; gap: 8px; }
.nav-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}
.nav-icon:hover { background: #EFF6FF; color: var(--primary); }
.nav-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; }
.bottom-nav-item { position: relative; }
.bottom-nav-item .nav-badge { top: -4px; right: 50%; transform: translateX(14px); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Footer */
.footer { background: var(--bg-dark); color: #CBD5E1; padding: 56px 0 0; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-logo { font-size: 28px; font-weight: 800; color: white; display: inline-block; margin-bottom: 12px; }
.footer-logo:hover { color: var(--secondary); }
.footer-desc { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin-bottom: 20px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 16px;
    transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); color: white; }
.footer-heading { color: white; font-size: 15px; font-weight: 600; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a { color: var(--text-muted); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.footer-col a i { font-size: 14px; width: 16px; text-align: center; }
.footer-col a:hover { color: white; padding-left: 4px; }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 0;
    margin-top: 0;
}
.footer-copy { color: var(--text-muted); font-size: 13px; margin: 0; }
.footer-payment { display: flex; align-items: center; gap: 8px; }
.footer-payment-label { font-size: 12px; color: var(--text-muted); }
.footer-payment-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #CBD5E1;
}

/* Mobile footer (simplified) */
.footer-mobile { display: none; }
.footer-mobile .footer-logo { display: block; text-align: center; margin-bottom: 16px; }
.footer-mobile-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 16px; }
.footer-mobile-links a { color: var(--text-muted); font-size: 13px; }
.footer-mobile-links a:hover { color: white; }
.footer-social-mobile { justify-content: center; }

/* Show/hide helpers */
.show-mobile-tablet { display: none; }
.show-mobile-tablet-inline { display: none; }

/* Mobile slide menu */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    display: none;
}
.mobile-menu.open { right: 0; }
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.mobile-menu-brand { font-size: 22px; font-weight: 800; color: var(--primary); }
.mobile-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.mobile-menu-close:hover { background: var(--bg-light); color: var(--danger); }
.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}
.mobile-menu-avatar img,
.mobile-menu-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.mobile-menu-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 18px;
}
.mobile-menu-user-info { display: flex; flex-direction: column; min-width: 0; }
.mobile-menu-user-info strong { font-size: 15px; color: var(--text-primary); line-height: 1.3; }
.mobile-menu-user-info span { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-menu-auth { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.btn-block { width: 100%; justify-content: center; text-align: center; }
.mobile-menu-section { padding: 12px 0; border-bottom: 1px solid var(--border); }
.mobile-menu-section-title {
    padding: 4px 20px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mobile-menu-section a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-primary);
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}
.mobile-menu-section a:hover { background: var(--bg-light); color: var(--primary); }
.mobile-menu-section a i { width: 18px; text-align: center; font-size: 16px; color: var(--text-muted); }
.mobile-menu-section a:hover i { color: var(--primary); }
.mobile-menu-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.mobile-menu-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.mobile-menu-logout:hover { background: #fef2f2; color: var(--danger); }
.mobile-menu-logout i { font-size: 16px; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #0f2557 100%);
    color: white;
    padding: 80px 16px 72px;
    text-align: center;
    position: relative;
    overflow: visible;
    z-index: 10;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(245,158,11,0.12) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero-title { font-size: 36px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.hero-highlight { color: var(--secondary); }
.hero-subtitle { font-size: 17px; color: rgba(255,255,255,0.8); margin-bottom: 32px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* Search Box */
.search-box { max-width: 800px; margin: 0 auto; position: relative; }

/* Search Bar */
.search-bar {
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--success); }
.search-bar-row {
    display: flex;
    align-items: center;
    height: 52px;
}

/* Filter toggle buttons (location + category) */
.search-bar-filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--transition);
}
.search-bar-filter-toggle:hover { color: var(--primary); }
.search-bar-filter-toggle > .bi:first-child { font-size: 14px; color: var(--text-muted); }
.search-bar-filter-label {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-bar-filter-chevron {
    font-size: 9px;
    transition: transform 0.3s;
    color: var(--text-muted);
}
.search-bar-filter-toggle.active .search-bar-filter-chevron { transform: rotate(180deg); }

/* Divider */
.search-bar-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

/* Main input */
.search-bar-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
    min-width: 0;
    position: relative;
}
.search-bar-main input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
}
.search-bar-main input::placeholder { color: var(--text-muted); }

/* Search button */
.search-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 5px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    flex-shrink: 0;
}
.search-bar-btn:hover { background: #059669; }

/* Reset button */
.search-bar-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: #EF4444;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: var(--transition);
}
.search-bar-reset:hover { background: #DC2626; color: white; }

/* Search suggestions */
.search-suggestions {
    position: absolute;
    top: calc(100% + 18px);
    left: -12px;
    right: -48px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
    padding: 6px 0;
    text-align: left;
}
.search-suggestion-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: var(--text-primary);
}
.search-suggestion-item:hover { background: var(--bg-light); }
.search-suggestion-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
.search-suggestion-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 18px;
}
.search-suggestion-body { flex: 1; min-width: 0; text-align: left; }
.search-suggestion-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggestion-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-top: 2px; flex-wrap: wrap; }
.search-suggestion-price { font-weight: 600; color: var(--primary); }
.search-suggestion-cat { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.search-suggestion-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.search-suggestion-priority-item { background: #fef9e7; }
.search-suggestion-priority-item:hover { background: #fef3c7; }
.search-suggestion-priority { color: #d97706; margin-right: 4px; font-size: 13px; }

/* Filter dropdown (shared by location + category) */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    z-index: 100;
    overflow: hidden;
    animation: filterDropdownIn 0.2s ease;
}
@keyframes filterDropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.filter-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.filter-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-primary);
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}
.filter-back-btn:hover { background: var(--bg-light); }
.filter-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    padding: 6px 0;
}
.filter-search-input::placeholder { color: var(--text-muted); }
.filter-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}
.filter-dropdown-list::-webkit-scrollbar { width: 4px; }
.filter-dropdown-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-primary);
    transition: background 0.15s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}
.filter-item:hover { background: var(--bg-light); }
.filter-item-right { display: flex; align-items: center; gap: 8px; }
.filter-item-count {
    background: var(--success);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}
.filter-item-chevron { color: var(--text-muted); font-size: 14px; }
.filter-item.selected { color: var(--primary); font-weight: 600; }
.filter-item-all { font-weight: 600; color: var(--text-primary); }

/* Home layout (sidebar + content) */
.home-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

/* Sidebar categories */
.home-sidebar {
    position: sticky;
    top: 80px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.home-sidebar::-webkit-scrollbar { width: 3px; }
.home-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar-category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
    color: var(--text-primary);
}
.sidebar-category-item:last-child { border-bottom: none; }
.sidebar-category-item:hover { background: var(--bg-light); }
.sidebar-category-item.active { background: #EFF6FF; color: var(--primary); }
.sidebar-category-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 16px;
    color: var(--primary);
    flex-shrink: 0;
}
.sidebar-category-name { flex: 1; font-weight: 500; line-height: 1.3; }
.sidebar-category-count {
    background: var(--success);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}
.sidebar-category-chevron { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }

/* Mobile categories (hidden on desktop) */
.mobile-categories { display: none; }
.mobile-categories-scroll {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.mobile-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    scroll-snap-align: start;
    flex-shrink: 0;
}
.mobile-cat-card:hover, .mobile-cat-card.active {
    border-color: var(--primary);
    background: #EFF6FF;
}
.mobile-cat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 22px;
    color: var(--primary);
}
.mobile-cat-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.mobile-cat-card { text-decoration: none; }
.mobile-cat-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.mobile-cat-count {
    font-size: 10px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: 10px;
    padding: 1px 6px;
    line-height: 1.4;
}

/* Home content */
.home-content { min-width: 0; }
.home-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.home-content-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}
.home-content-sort select {
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
    background: transparent;
    cursor: pointer;
}
.home-content-sort .bi-funnel { color: var(--text-muted); }

/* Ads loading state */
.ads-grid-loading {
    display: flex;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 14px;
    gap: 8px;
}

/* Sections */
.section { padding: 48px 0; }
.section-alt { background: white; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); }
.section-title-center { justify-content: center; margin-bottom: 12px; }
.section-subtitle {
    text-align: center;
    font-size: 15px;
    color: #64748B;
    margin: 0 auto 40px;
    max-width: 520px;
    line-height: 1.6;
}

/* Form 2-column row */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.section-link { font-size: 14px; color: var(--primary); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.section-link:hover { color: var(--primary-dark); }

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 12px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
    color: var(--text-primary);
}
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); color: var(--primary); }
.category-card-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: #EFF6FF; border-radius: 12px; font-size: 22px; color: var(--primary); transition: var(--transition); }
.category-card:hover .category-card-icon { background: var(--primary); color: white; }
.category-card-name { font-size: 14px; font-weight: 600; }
.category-card-count { font-size: 12px; color: var(--text-muted); }

/* CTA */
.section-cta { padding: 48px 0; }
.cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
}
.cta-content h2 { font-size: 24px; margin-bottom: 8px; }
.cta-content p { color: rgba(255,255,255,0.8); }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* Empty State */
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

/* End of ads */
.end-of-ads { grid-column: 1 / -1; text-align: center; padding: 32px 16px; color: var(--text-muted); }
.end-of-ads i { font-size: 28px; display: block; margin-bottom: 8px; color: var(--primary); }
.end-of-ads p { font-size: 14px; margin: 0; }

/* Infinite scroll loader */
.scroll-loader { grid-column: 1 / -1; text-align: center; padding: 24px 16px; color: var(--text-muted); }
.scroll-loader i { font-size: 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ad Card */
.ad-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.ad-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.ad-card-img { position: relative; display: block; overflow: hidden; }
.ad-card-img img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.3s ease; }
.ad-card:hover .ad-card-img img { transform: scale(1.05); }
.ad-card-badge { background: var(--success, #22c55e); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; margin-right: auto; }
.ad-card-badge-priority { background: linear-gradient(135deg, #d97706, #f59e0b); display: flex; align-items: center; gap: 3px; }
.ad-card-priority { border: 2px solid #d97706; box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.1), var(--shadow); }
.ad-card-priority:hover { box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.2), var(--shadow-lg); }
.priority-ads-section { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 2px solid #fef3c7; }
.ad-card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.ad-card-title { font-size: 15px; margin-bottom: 6px; line-height: 1.3; }
.ad-card-title a { color: var(--text-primary); text-decoration: none; }
.ad-card-title a:hover { color: var(--primary); }
.ad-card-price { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.ad-card-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.ad-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ad-card-location, .ad-card-date { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.ad-card-seller { display: flex; align-items: center; gap: 6px; }
.ad-card-seller-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.ad-card-seller-placeholder { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.ad-card-seller-name { font-size: 12px; color: var(--text-secondary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.ad-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ad-card-overlay { position: absolute; top: 0; right: 0; left: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 8px; gap: 6px; z-index: 2; }
.ad-card-views { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,0.55); padding: 3px 8px; border-radius: 4px; backdrop-filter: blur(4px); margin-left: auto; }
.ad-card-location-row { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.3; }
.ad-card-location-row i { color: var(--danger); font-size: 11px; flex-shrink: 0; }
.ad-card-engage { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.ad-card-like-btn { display: flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; font-size: 13px; color: var(--text-muted); font-weight: 500; padding: 0; transition: var(--transition); }
.ad-card-like-btn:hover { color: var(--primary); }
.ad-card-like-btn.active { color: var(--primary); }
.ad-card-like-static { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.ad-card-date { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.ad-card-stats { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.ad-card-rating { display: flex; align-items: center; gap: 3px; color: #f59e0b; font-weight: 600; font-size: 12px; }
.ad-card-rating small { color: var(--text-muted); font-weight: 400; }
.ad-card-likes { display: flex; align-items: center; gap: 3px; color: var(--primary); }
.ad-card-favs { display: flex; align-items: center; gap: 3px; color: var(--danger); }

/* Ads Grid */
.ads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; padding: 24px 0; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 12px 0; font-size: 14px; color: var(--text-muted); }
.breadcrumb .current { color: var(--text-primary); }

/* Rating */
.rating-stars { display: inline-flex; align-items: center; gap: 2px; color: var(--secondary); }
.rating-count { color: var(--text-muted); font-size: 13px; margin-left: 4px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 24px 0; }
.pagination a {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
}
.pagination a.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-container { width: 100%; max-width: 420px; padding: 32px; background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* Admin */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 250px;
    background: var(--bg-dark);
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: var(--text-muted);
    font-size: 14px;
}
.admin-sidebar nav a:hover { color: white; background: rgba(255,255,255,0.05); }
.admin-content { flex: 1; margin-left: 250px; padding: 24px; }

/* Ad Detail Layout */
.ad-detail {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    padding: 24px 0 48px;
    align-items: start;
}
.ad-detail-main { min-width: 0; }
.ad-detail-sidebar {
    position: sticky;
    top: 76px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Ad Gallery */
.ad-gallery {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.ad-gallery-main {
    position: relative;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-gallery-main img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gallery-nav:hover { background: white; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.gallery-nav-prev { left: 12px; }
.gallery-nav-next { right: 12px; }
.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.ad-gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ad-gallery-thumbs::-webkit-scrollbar { display: none; }
.ad-gallery-thumbs img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    border: 2px solid transparent;
    flex-shrink: 0;
}
.ad-gallery-thumbs img:hover { opacity: 0.8; }
.ad-gallery-thumbs img.active {
    opacity: 1;
    border-color: var(--primary);
}

/* Ad Sections */
.ad-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.ad-section-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}
.ad-section-title i { color: var(--primary); font-size: 18px; }
.ad-description {
    font-size: 15px;
    line-height: 1.8;
    color: #475569;
    word-wrap: break-word;
}

/* Ad Details Grid */
.ad-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ad-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius);
}
.ad-detail-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ad-detail-label i { font-size: 13px; }
.ad-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Ad Sidebar Cards */
.ad-price-card,
.ad-seller-card,
.ad-safety-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.ad-price-main {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.2;
}
.ad-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 0 8px;
    line-height: 1.4;
}
.ad-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.ad-meta span { display: flex; align-items: center; gap: 6px; }
.ad-meta i { font-size: 14px; }
.leaflet-container { position: relative; z-index: 1 !important; }

.ad-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ad-action-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}
.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
}
.btn-whatsapp:hover { background: #1fb855; color: white; }

/* Ad Seller */
.ad-seller-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.ad-seller-header:hover { color: inherit; }
.ad-seller-avatar {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.ad-seller-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}
.ad-seller-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}
.ad-seller-verified {
    position: absolute;
    bottom: -2px;
    right: -2px;
    color: var(--primary);
    font-size: 16px;
    background: white;
    border-radius: 50%;
    line-height: 1;
}
.ad-seller-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.ad-seller-info strong {
    font-size: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Ad Seller Stats */
.ad-seller-stats {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    margin-bottom: 14px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.ad-seller-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.ad-seller-stat i { font-size: 15px; color: var(--primary); }
.ad-seller-stat strong { color: var(--text-primary); }

/* Ad Safety */
.ad-safety-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
}
.ad-safety-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ad-safety-card li {
    font-size: 13px;
    color: #475569;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}
.ad-safety-card li::before {
    content: '\F272';
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 0;
    color: var(--success);
    font-size: 11px;
}

/* ============================================================ */
/* Seller Public Profile                                        */
/* ============================================================ */
.seller-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #0f2557 100%);
    color: white;
    padding: 32px 0 40px;
    position: relative;
    overflow: hidden;
}
.seller-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -25%;
    width: 150%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.seller-hero .breadcrumb {
    justify-content: flex-start;
    color: rgba(255,255,255,0.6);
    margin-bottom: 20px;
    font-size: 13px;
    position: relative;
}
.seller-hero .breadcrumb a { color: rgba(255,255,255,0.6); }
.seller-hero .breadcrumb a:hover { color: white; }
.seller-hero .breadcrumb .current { color: white; font-weight: 500; }

.seller-hero-content {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
}
.seller-hero-avatar {
    position: relative;
    flex-shrink: 0;
}
.seller-hero-avatar img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
}
.seller-hero-avatar-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    border: 3px solid rgba(255,255,255,0.3);
}
.seller-hero-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    color: #60a5fa;
    font-size: 22px;
    background: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.seller-hero-info h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.seller-hero-info h1 i { color: #60a5fa; font-size: 20px; }
.seller-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
}
.seller-hero-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.seller-hero-meta i { font-size: 14px; }
.seller-hero-meta .badge { font-size: 11px; }
.seller-hero-bio {
    margin-top: 12px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    max-width: 600px;
}

/* Seller Layout */
.seller-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    padding: 24px 0 48px;
    align-items: start;
}
.seller-main { min-width: 0; }
.seller-sidebar {
    position: sticky;
    top: 76px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Seller Stats Row */
.seller-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.seller-stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}
.seller-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--bg-light);
    color: var(--text-muted);
}
.seller-stat-icon.blue { background: #dbeafe; color: var(--primary); }
.seller-stat-icon.green { background: #d1fae5; color: var(--success); }
.seller-stat-icon.yellow { background: #fef3c7; color: var(--warning); }
.seller-stat-card strong {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}
.seller-stat-card span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Load More */
.load-more { text-align: center; padding: 24px 0; }
.load-more .btn { min-width: 200px; }

/* Bottom Navigation (mobile/tablet) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

/* ============================================================ */
/* Admin Settings Page                                          */
/* ============================================================ */
.admin-settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-settings-header h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.admin-stat-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.admin-stat-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.admin-stat-icon.blue { background: #dbeafe; color: var(--primary); }
.admin-stat-icon.green { background: #d1fae5; color: var(--success); }
.admin-stat-icon.yellow { background: #fef3c7; color: var(--warning); }
.admin-stat-icon.red { background: #fee2e2; color: var(--danger); }
.admin-stat-info h3 { font-size: 24px; font-weight: 700; line-height: 1; margin: 0; }
.admin-stat-info p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.admin-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--primary) transparent; padding-bottom: 2px; }
.admin-tabs::-webkit-scrollbar { height: 3px; }
.admin-tabs::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
.admin-tabs::-webkit-scrollbar-track { background: transparent; }
.admin-tab { padding: 12px 20px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; font-size: 14px; font-weight: 500; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; display: flex; align-items: center; gap: 8px; transition: var(--transition); font-family: inherit; }
.admin-tab:hover { color: var(--primary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab .tab-count { background: var(--bg-light); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.admin-tab.active .tab-count { background: #dbeafe; color: var(--primary); }

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

.admin-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: visible; }
.admin-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.admin-card-header h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.admin-card-body { padding: 20px; }

.admin-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-table th { background: var(--bg-light); font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table tr:hover { background: #f8fafc; }
.admin-table .actions { display: flex; gap: 6px; }

.status-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-badge.active, .status-badge.completed, .status-badge.resolved { background: #d1fae5; color: #065f46; }
.status-badge.inactive, .status-badge.failed, .status-badge.dismissed { background: #fee2e2; color: #991b1b; }
.status-badge.pending, .status-badge.reviewed { background: #fef3c7; color: #92400e; }

.admin-inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.admin-inline-form .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }
.admin-inline-form .form-control { padding: 8px 12px; font-size: 13px; }
.admin-inline-form .btn { padding: 8px 16px; font-size: 13px; white-space: nowrap; height: 38px; }

.settings-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }

.admin-sidebar nav a.active { color: white; background: rgba(255,255,255,0.1); border-right: 3px solid var(--primary); }

/* ══════════════════════════════════════════════ */
/* ── Messaging                              ── */
/* ══════════════════════════════════════════════ */

/* Inbox */
.msg-inbox { max-width: 720px; margin: 24px auto; }
.msg-inbox-header { padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.msg-inbox-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.msg-inbox-title i { color: var(--primary); }

.msg-empty { text-align: center; padding: 64px 24px; }
.msg-empty i { font-size: 48px; color: var(--text-muted); margin-bottom: 16px; display: block; }
.msg-empty h3 { font-size: 18px; margin-bottom: 8px; }
.msg-empty p { color: var(--text-muted); margin-bottom: 20px; }

.msg-list { display: flex; flex-direction: column; }
.msg-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: var(--transition); border-radius: var(--radius); }
.msg-item:hover { background: var(--bg-light); }
.msg-item-unread { background: rgba(30, 64, 175, 0.04); }
.msg-item-unread .msg-item-name { font-weight: 700; }
.msg-item-unread .msg-item-preview { font-weight: 600; color: var(--text-primary); }

.msg-item-avatar { flex-shrink: 0; }
.msg-item-avatar img, .msg-avatar-placeholder { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.msg-avatar-placeholder { display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 700; font-size: 18px; }

.msg-item-content { flex: 1; min-width: 0; }
.msg-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.msg-item-name { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.msg-item-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.msg-item-ad { font-size: 12px; color: var(--primary); margin-bottom: 3px; display: flex; align-items: center; gap: 4px; }
.msg-item-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.msg-item-preview { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item-badge { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0; }

.msg-item-thumb { flex-shrink: 0; }
.msg-item-thumb img { width: 52px; height: 52px; border-radius: var(--radius); object-fit: cover; }

/* Conversation */
.msg-conversation { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 130px); min-height: 400px; }

.msg-conv-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: white; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; flex-shrink: 0; }
.msg-conv-back { font-size: 20px; color: var(--text-primary); display: flex; align-items: center; padding: 4px; }
.msg-conv-back:hover { color: var(--primary); }

.msg-conv-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.msg-conv-avatar img, .msg-conv-avatar .msg-avatar-placeholder { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.msg-conv-avatar .msg-avatar-placeholder { font-size: 15px; }
.msg-conv-user-info { display: flex; flex-direction: column; }
.msg-conv-user-info strong { font-size: 15px; line-height: 1.2; }
.msg-conv-status { font-size: 12px; color: var(--success); }

.msg-conv-ad { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg-light); border-radius: var(--radius); text-decoration: none; color: inherit; flex-shrink: 0; transition: var(--transition); }
.msg-conv-ad:hover { box-shadow: var(--shadow); }
.msg-conv-ad img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.msg-conv-ad-info { display: flex; flex-direction: column; }
.msg-conv-ad-title { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.msg-conv-ad-price { font-size: 12px; font-weight: 700; color: var(--primary); }

/* Message body/scroll area */
.msg-conv-body { flex: 1; overflow-y: auto; padding: 20px 16px; background: var(--bg-light); display: flex; flex-direction: column; gap: 4px; }

.msg-conv-start { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.msg-conv-start i { font-size: 40px; display: block; margin-bottom: 12px; }

.msg-date-sep { text-align: center; padding: 12px 0; }
.msg-date-sep span { background: white; padding: 4px 14px; border-radius: 12px; font-size: 12px; color: var(--text-muted); box-shadow: var(--shadow); }

/* Bubbles */
.msg-bubble { max-width: 75%; padding: 10px 14px; border-radius: 16px; position: relative; animation: msgFadeIn 0.2s ease; word-wrap: break-word; }
.msg-mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-theirs { align-self: flex-start; background: white; color: var(--text-primary); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.msg-bubble-text { font-size: 14px; line-height: 1.5; }
.msg-bubble-time { font-size: 10px; opacity: 0.7; display: block; text-align: right; margin-top: 4px; }
.msg-mine .msg-bubble-time { color: rgba(255,255,255,0.7); }
.msg-theirs .msg-bubble-time { color: var(--text-muted); }

.msg-new { animation: msgSlideIn 0.3s ease; }
@keyframes msgSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes msgFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Footer / input */
.msg-conv-footer { padding: 12px 16px; background: white; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); flex-shrink: 0; }
.msg-form { display: flex; align-items: flex-end; gap: 8px; }
.msg-input-wrap { flex: 1; }
.msg-input-wrap textarea { width: 100%; border: 1px solid var(--border); border-radius: 20px; padding: 10px 16px; font-size: 14px; resize: none; outline: none; line-height: 1.5; max-height: 120px; font-family: inherit; transition: border-color 0.2s; }
.msg-input-wrap textarea:focus { border-color: var(--primary); }
.msg-attach-btn { width: 38px; height: 38px; border-radius: 50%; background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; transition: var(--transition); }
.msg-attach-btn:hover { color: var(--primary); background: var(--bg-light); }
.msg-send-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; transition: var(--transition); }
.msg-send-btn:hover { background: var(--primary-dark); }
.msg-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Media bubbles */
.msg-bubble-image { margin: -4px -6px 4px; }
.msg-bubble-image img { max-width: 260px; max-height: 260px; border-radius: 12px; cursor: pointer; display: block; object-fit: cover; }
.msg-mine .msg-bubble-image img { border-bottom-right-radius: 4px; }
.msg-theirs .msg-bubble-image img { border-bottom-left-radius: 4px; }
.msg-bubble-audio { margin: 0 -4px 2px; }
.msg-bubble-audio audio { width: 220px; height: 36px; }
.msg-mine .msg-bubble-audio audio { filter: brightness(2) contrast(0.8); }

/* Image preview before send */
.msg-preview { padding: 8px 16px; background: var(--bg-light); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.msg-preview img { height: 80px; max-width: 120px; object-fit: cover; border-radius: var(--radius); }
.msg-preview-close { width: 28px; height: 28px; border-radius: 50%; background: var(--danger); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* Audio recording bar */
.msg-recording { padding: 12px 16px; background: white; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.msg-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: recPulse 1s ease infinite; flex-shrink: 0; }
@keyframes recPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.msg-rec-text { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.msg-rec-timer { font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; flex: 1; }
.msg-rec-cancel { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-light); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.msg-rec-cancel:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.msg-rec-send { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* Lightbox */
.msg-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.msg-lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 4px; }

/* Favorite button on ad card */
.ad-card-fav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 2;
    backdrop-filter: blur(4px);
}
.ad-card-fav:hover { background: white; color: var(--danger); transform: scale(1.1); }
.ad-card-fav.active { color: var(--danger); background: white; }
.ad-card-fav.active:hover { transform: scale(1.1); }

/* Favorite button on ad detail */
.ad-fav-btn.active { color: var(--danger); border-color: var(--danger); }
.ad-fav-btn.active:hover { background: #fef2f2; }

/* ── Favorites Page ── */
.fav-page { padding: 24px 0 48px; }
.fav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.fav-header-left { display: flex; align-items: center; gap: 12px; }
.fav-header-left h1 { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.fav-header-left h1 i { color: var(--danger); }
.fav-count { background: var(--bg-light); color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.fav-empty {
    text-align: center;
    padding: 64px 24px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.fav-empty i { font-size: 64px; color: var(--border); display: block; margin-bottom: 16px; }
.fav-empty h3 { font-size: 20px; margin-bottom: 8px; color: var(--text-primary); }
.fav-empty p { color: var(--text-muted); margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }
