/* =========================================================
   MALIPO — DESIGN SYSTEM
   ========================================================= */

:root {
    --emerald-900: #04261d;
    --emerald-800: #073b2c;
    --emerald-700: #0a5c40;
    --emerald-600: #0e7a54;
    --emerald-500: #12996a;
    --emerald-400: #1cb87f;
    --gold-500: #f2b134;
    --gold-400: #ffc94d;
    --ink-900: #10181a;
    --ink-700: #2c3a3d;
    --ink-500: #5c6e72;
    --ink-300: #8fa1a4;
    --surface: #f4f9f7;
    --surface-2: #ffffff;
    --border: #e3ece8;
    --danger: #e0433c;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(4, 38, 29, 0.06);
    --shadow-md: 0 10px 30px rgba(4, 38, 29, 0.10);
    --shadow-lg: 0 24px 60px rgba(4, 38, 29, 0.18);
    --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--surface);
    color: var(--ink-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14.5px;
    border: none;
    transition: all .18s ease;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--emerald-900);
    box-shadow: 0 8px 20px rgba(242, 177, 52, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(242, 177, 52, 0.45); }
.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.5);
    color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }
.btn-ghost {
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    color: var(--ink-700);
}
.btn-ghost:hover { border-color: var(--emerald-500); color: var(--emerald-700); }
.btn-dark {
    background: var(--emerald-800);
    color: #fff;
}
.btn-dark:hover { background: var(--emerald-700); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }

/* =========================================================
   TOPBAR + HEADER
   ========================================================= */
.topbar {
    background: var(--emerald-900);
    color: rgba(255,255,255,0.75);
    font-size: 12.5px;
    padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { opacity: .9; }
.topbar a:hover { opacity: 1; text-decoration: underline; }

.site-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 26px;
    color: var(--emerald-800);
    flex-shrink: 0;
}
.logo .dot { color: var(--gold-500); }
.header-search {
    flex: 1;
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.header-search select {
    border: none;
    background: transparent;
    padding: 0 14px;
    font-size: 14px;
    color: var(--ink-700);
    border-right: 1px solid var(--border);
    max-width: 150px;
}
.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 14.5px;
    outline: none;
}
.header-search button {
    background: var(--emerald-700);
    color: #fff;
    border: none;
    padding: 0 22px;
    font-size: 15px;
}
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 18px;
    position: relative;
    color: var(--ink-700);
}
.icon-btn:hover { background: var(--emerald-50, #e8f5f0); }
.badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 999px; padding: 1px 5px;
    min-width: 16px; text-align: center;
}
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 14px; font-weight: 600;
    color: var(--ink-700);
}
.user-chip .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--emerald-600); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 10px);
    background: #fff; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    width: 210px; padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all .16s ease;
    border: 1px solid var(--border);
    z-index: 200;
}
.dropdown:hover .dropdown-menu, .dropdown.open .dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-700);
}
.dropdown-menu a:hover { background: var(--surface); color: var(--emerald-700); }

/* Category nav strip */
.category-strip {
    background: var(--emerald-800);
}
.category-strip .container { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.category-strip .container::-webkit-scrollbar { display: none; }
.category-strip a {
    color: rgba(255,255,255,0.85);
    font-size: 13.5px; font-weight: 500;
    padding: 11px 14px;
    white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
    border-bottom: 2px solid transparent;
}
.category-strip a:hover { color: #fff; border-color: var(--gold-500); background: rgba(255,255,255,0.05); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
    position: relative;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,201,77,0.25), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(28,184,127,0.35), transparent 50%),
        linear-gradient(120deg, var(--emerald-900) 0%, var(--emerald-700) 55%, var(--emerald-500) 130%);
    color: #fff;
    overflow: hidden;
    padding: 64px 0 90px;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: .5;
}
.hero .container { position: relative; z-index: 2; text-align: center; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 600;
    margin-bottom: 22px;
    backdrop-filter: blur(6px);
}
.hero h1 {
    font-size: 44px;
    font-weight: 800;
    max-width: 760px;
    margin: 0 auto 14px;
    letter-spacing: -0.5px;
}
.hero h1 span { color: var(--gold-400); }
.hero p.subtitle {
    color: rgba(255,255,255,0.82);
    font-size: 16.5px;
    max-width: 560px;
    margin: 0 auto 36px;
}
.hero-search {
    max-width: 780px;
    margin: 0 auto;
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: stretch;
    padding: 6px;
}
.hero-search select {
    border: none; background: var(--surface);
    border-radius: 999px 0 0 999px;
    padding: 0 18px; font-size: 14.5px; color: var(--ink-700);
    max-width: 170px; font-weight: 500;
}
.hero-search input {
    flex: 1; border: none; outline: none;
    padding: 16px 18px; font-size: 15.5px; color: var(--ink-900);
}
.hero-search button {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--emerald-900);
    border: none; border-radius: 999px;
    padding: 0 30px; font-weight: 700; font-size: 14.5px;
    display: flex; align-items: center; gap: 8px;
}
.hero-stats {
    display: flex; justify-content: center; gap: 48px;
    margin-top: 44px; flex-wrap: wrap;
}
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-size: 26px; font-weight: 800; color: var(--gold-400); }
.hero-stats span { font-size: 13px; color: rgba(255,255,255,0.75); }

/* Quick action tiles (Niche intelligence / apply for job / etc) */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: -56px;
    position: relative;
    z-index: 5;
}
.quick-tile {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; gap: 10px;
    transition: transform .18s ease, box-shadow .18s ease;
    border: 1px solid var(--border);
}
.quick-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.quick-tile .icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.quick-tile:nth-child(1) .icon { background: #eaf1ff; }
.quick-tile:nth-child(2) .icon { background: #fff3e0; }
.quick-tile:nth-child(3) .icon { background: #e9fbf1; }
.quick-tile:nth-child(4) .icon { background: #f3edff; }
.quick-tile strong { font-size: 15.5px; color: var(--ink-900); }
.quick-tile span.desc { font-size: 12.5px; color: var(--ink-500); }

/* =========================================================
   LAYOUT: SIDEBAR + CONTENT
   ========================================================= */
.page-wrap { padding: 40px 0 70px; }
.layout-grid { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; }
.layout-grid > div { min-width: 0; } /* allow content column to shrink instead of forcing page-wide overflow */

.sidebar-card {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.sidebar-card h3 {
    padding: 16px 18px; font-size: 15px; font-weight: 700;
    border-bottom: 1px solid var(--border); color: var(--ink-900);
}
.sidebar-cat-list a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px; font-size: 14px; color: var(--ink-700);
    border-bottom: 1px solid var(--border);
    transition: background .15s ease;
}
.sidebar-cat-list a:last-child { border-bottom: none; }
.sidebar-cat-list a:hover { background: var(--surface); color: var(--emerald-700); }
.sidebar-cat-list .left { display: flex; align-items: center; gap: 10px; }
.sidebar-cat-list .count { color: var(--ink-300); font-size: 12.5px; }
.sidebar-cat-list a.active { background: #e9fbf1; color: var(--emerald-700); font-weight: 600; }

/* Section headers */
.section-heading {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.section-heading h2 { font-size: 21px; font-weight: 800; color: var(--ink-900); }
.section-heading a.view-all { font-size: 13.5px; font-weight: 600; color: var(--emerald-700); }

/* Category grid on homepage */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 46px;
}
.cat-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 14px;
    text-align: center;
    transition: all .18s ease;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--emerald-400); }
.cat-card .emoji { font-size: 30px; margin-bottom: 10px; }
.cat-card .name { font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.cat-card .count { font-size: 11.5px; color: var(--ink-300); margin-top: 2px; }

/* =========================================================
   LISTING / AD CARDS
   ========================================================= */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.listing-card {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all .2s ease;
    position: relative;
    display: flex; flex-direction: column;
}
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); border-color: transparent; }
.listing-card .thumb {
    position: relative;
    aspect-ratio: 4 / 3.1;
    background: var(--surface) url('../img/placeholder.svg') center/cover no-repeat;
    overflow: hidden;
}
.listing-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-card .badge-featured {
    position: absolute; top: 10px; left: 10px;
    background: var(--gold-500); color: var(--emerald-900);
    font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .4px;
}
.listing-card .fav-btn {
    position: absolute; top: 10px; right: 10px;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.92);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; border: none; color: var(--danger);
}
.listing-card .body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.listing-card .price { font-size: 18px; font-weight: 800; color: var(--emerald-700); }
.listing-card .title {
    font-size: 14px; font-weight: 600; color: var(--ink-900);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 38px;
}
.listing-card .meta {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; color: var(--ink-300); margin-top: auto; padding-top: 6px;
}
.listing-card .meta .loc { display: flex; align-items: center; gap: 4px; }

/* Trending strip section bg */
.section-alt { background: var(--surface-2); padding: 48px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* CTA banner */
.cta-banner {
    margin: 50px 0 10px;
    background: linear-gradient(120deg, var(--emerald-800), var(--emerald-600));
    border-radius: var(--radius-lg);
    padding: 44px 50px;
    display: flex; align-items: center; justify-content: space-between;
    color: #fff; gap: 30px;
    position: relative; overflow: hidden;
}
.cta-banner::after {
    content: ''; position: absolute; right: -40px; top: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.cta-banner h3 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.cta-banner p { color: rgba(255,255,255,0.82); font-size: 14.5px; max-width: 420px; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--emerald-900); color: rgba(255,255,255,0.7); margin-top: 60px; }
.footer-grid {
    display: grid; grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: 30px; padding: 80px 0 48px;
}
.footer-grid .logo { color: #fff; margin-bottom: 12px; }
.footer-grid p.about { font-size: 13.5px; line-height: 1.7; color: rgba(255,255,255,0.6); max-width: 280px; }
.footer-grid h4 { color: #fff; font-size: 14.5px; margin-bottom: 16px; }
.footer-grid ul li { margin-bottom: 10px; font-size: 13.5px; }
.footer-grid ul li a:hover { color: var(--gold-400); }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
}
.footer-app-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; }
.footer-app-row .app-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: rgba(255,255,255,0.5); cursor: pointer; }
.footer-app-row .badge-soon {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.65);
    padding: 3px 8px; border-radius: 999px;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0 32px; font-size: 12.5px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* Lightweight toast for "coming soon" style notices */
.toast-notice {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
    background: var(--emerald-800); color: #fff;
    padding: 12px 22px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
    z-index: 1000;
}
.toast-notice.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   AUTH PAGES
   ========================================================= */
.auth-wrap {
    min-height: calc(100vh - 90px);
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 10% 10%, rgba(28,184,127,0.12), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(242,177,52,0.12), transparent 40%),
        var(--surface);
    padding: 50px 20px;
}
.auth-card {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    max-width: 430px;
    width: 100%;
    border: 1px solid var(--border);
}
.auth-card .logo { justify-content: center; margin-bottom: 6px; }
.auth-card h2 { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-card p.sub { text-align: center; color: var(--ink-500); font-size: 13.5px; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink-700); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); font-size: 14.5px; font-family: inherit;
    outline: none; transition: border-color .15s ease, box-shadow .15s ease;
    background: var(--surface);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--emerald-500); box-shadow: 0 0 0 4px rgba(18,153,106,0.12); background: #fff;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--ink-300); margin-top: 5px; }

.alert {
    padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px;
    margin-bottom: 20px; border: 1px solid transparent;
}
.alert-success { background: #e9fbf1; color: var(--emerald-700); border-color: #b8ecd4; }
.alert-error { background: #fdeeee; color: var(--danger); border-color: #f6c6c4; }
.alert-info { background: #eaf1ff; color: #1d4ed8; border-color: #c7dbff; }

.auth-divider { text-align: center; color: var(--ink-300); font-size: 12.5px; margin: 22px 0; position: relative; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--ink-500); margin-top: 18px; }
.auth-foot a { color: var(--emerald-700); font-weight: 700; }

/* =========================================================
   LISTING DETAIL PAGE
   ========================================================= */
.breadcrumb { font-size: 13px; color: var(--ink-500); margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--emerald-700); }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start; }
.detail-grid > div { min-width: 0; }
.gallery-main {
    border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/11;
    background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; }
.gallery-thumbs img {
    width: 76px; height: 76px; object-fit: cover; border-radius: 10px;
    border: 2px solid transparent; cursor: pointer;
}
.gallery-thumbs img.active { border-color: var(--emerald-500); }
.detail-info { background: var(--surface-2); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 26px; }
.detail-info .price { font-size: 30px; font-weight: 800; color: var(--emerald-700); margin-bottom: 6px; }
.detail-info h1 { font-size: 20px; font-weight: 700; margin-bottom: 10px; color: var(--ink-900); }
.detail-info .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag-pill {
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
    padding: 5px 12px; font-size: 12px; color: var(--ink-700); font-weight: 500;
}
.seller-box {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; border-radius: var(--radius-sm); background: var(--surface);
    margin: 18px 0;
}
.seller-box .avatar {
    width: 46px; height: 46px; border-radius: 50%; background: var(--emerald-600); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink:0;
}
.seller-box .info strong { display: block; font-size: 14.5px; }
.seller-box .info span { font-size: 12px; color: var(--ink-500); }
.desc-block { margin-top: 26px; }
.desc-block h3 { font-size: 15.5px; margin-bottom: 10px; }
.desc-block p { color: var(--ink-700); font-size: 14.5px; line-height: 1.8; white-space: pre-line; }

/* =========================================================
   DASHBOARD
   ========================================================= */
.dash-grid { display: grid; grid-template-columns: 250px 1fr; gap: 26px; }
.dash-grid > div { min-width: 0; } /* allow content column to shrink instead of forcing page-wide overflow */
.dash-nav { background: var(--surface-2); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 10px; height: fit-content; }
.dash-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink-700); }
.dash-nav a:hover, .dash-nav a.active { background: #e9fbf1; color: var(--emerald-700); font-weight: 700; }
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--emerald-700); }
.stat-card .label { font-size: 12.5px; color: var(--ink-500); margin-top: 4px; }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface-2); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.data-table th { text-align: left; font-size: 12.5px; text-transform: uppercase; color: var(--ink-300); background: var(--surface); padding: 12px 16px; }
.data-table td { padding: 14px 16px; font-size: 13.5px; border-top: 1px solid var(--border); color: var(--ink-700); }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-active { background: #e9fbf1; color: var(--emerald-700); }
.status-pending { background: #fff8e6; color: #a16207; }
.status-sold { background: #eee; color: #666; }
.status-rejected { background: #fdeeee; color: var(--danger); }
.inline-action-form { display: inline-block; margin: 0 4px 0 0; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--ink-500); }
.empty-state .emoji { font-size: 50px; margin-bottom: 14px; }

/* Post ad form image uploader */
.uploader-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 8px; }
.uploader-slot {
    aspect-ratio: 1; border: 2px dashed var(--border); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
    color: var(--ink-300); font-size: 11px; cursor: pointer; position: relative; overflow: hidden;
}
.uploader-slot:hover { border-color: var(--emerald-500); color: var(--emerald-600); }
.uploader-slot-required { border-color: #f2c4c2; background: #fff9f9; }
.uploader-slot-required:hover { border-color: var(--emerald-500); background: transparent; }
.uploader-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.uploader-slot img { position: absolute; inset:0; width: 100%; height: 100%; object-fit: cover; }

/* Admin mobile menu toggle — hidden by default, shown only on small screens below */
.admin-menu-toggle { display: none; }
.admin-overlay { display: none; }

/* =========================================================
   RESPONSIVE — tablet, phone, and small-phone tiers
   ========================================================= */

/* ---- Tablet & below (≤980px) ---- */
@media (max-width: 980px) {
    .layout-grid, .detail-grid, .dash-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2,1fr); margin-top: -40px; }
    .cat-grid { grid-template-columns: repeat(3,1fr); }
    .listing-grid { grid-template-columns: repeat(2,1fr); }
    .footer-grid { grid-template-columns: repeat(2,1fr); }
    .stat-cards { grid-template-columns: repeat(2,1fr); }
    .hero h1 { font-size: 32px; }
    .container { padding: 0 18px; }
}

/* ---- Phone (≤768px) — header search drops to its own full-width row ---- */
@media (max-width: 768px) {
    .site-header .container {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .logo { font-size: 22px; }
    .header-search {
        order: 4;
        flex: 1 1 100%;
        width: 100%;
    }
    .header-actions { gap: 6px; }
    .icon-btn { width: 38px; height: 38px; font-size: 16px; }
    .user-chip span:not(.avatar) { display: none; }
    .user-chip { padding: 5px; }
    .btn-primary.header-sell { padding: 10px 14px; font-size: 13px; }

    .topbar .container { flex-wrap: wrap; gap: 4px; font-size: 11.5px; }
    .topbar span:last-child { display: flex; gap: 10px; }

    .category-strip a { padding: 10px 12px; font-size: 12.5px; }

    .hero { padding: 40px 0 64px; }
    .hero-eyebrow { font-size: 12px; padding: 5px 12px; margin-bottom: 16px; }
    .hero h1 { font-size: 26px; line-height: 1.25; }
    .hero p.subtitle { font-size: 14px; margin-bottom: 26px; }
    .hero-stats { gap: 26px; margin-top: 32px; }
    .hero-stats strong { font-size: 20px; }

    .quick-actions { grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: -36px; }
    .quick-tile { padding: 16px 14px; }

    .cat-grid { grid-template-columns: repeat(3,1fr); gap: 10px; }
    .cat-card { padding: 16px 10px; }
    .cat-card .emoji { font-size: 24px; margin-bottom: 6px; }

    .listing-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
    .listing-card .body { padding: 10px 12px 12px; }
    .listing-card .price { font-size: 15.5px; }
    .listing-card .title { font-size: 12.5px; min-height: 34px; }

    .cta-banner { flex-direction: column; text-align: center; padding: 32px 24px; }
    .cta-banner h3 { font-size: 20px; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; padding: 40px 0 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }

    .form-row { grid-template-columns: 1fr; gap: 0; }
    .auth-card { padding: 32px 22px; max-width: 100%; }
    .auth-wrap { padding: 30px 16px; }

    .detail-info { padding: 20px; }
    .detail-info .price { font-size: 24px; }
    .seller-box { flex-wrap: wrap; }

    .dash-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
    .dash-nav a { flex: 1 1 auto; justify-content: center; padding: 10px; font-size: 13px; white-space: nowrap; }
    .stat-cards { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .num { font-size: 20px; }

    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 640px; }
    .data-table td .btn, .data-table td a.btn { margin-bottom: 4px; }

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

    .gallery-thumbs { flex-wrap: wrap; }
    .gallery-thumbs img { width: 62px; height: 62px; }

    /* Admin panel — sidebar becomes a slide-in drawer */
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed; top: 0; left: -270px; bottom: 0; width: 250px;
        z-index: 999; overflow-y: auto; transition: left .22s ease;
        box-shadow: var(--shadow-lg);
    }
    .admin-sidebar.open { left: 0; }
    .admin-overlay {
        display: none; position: fixed; inset: 0; background: rgba(4,38,29,0.45);
        z-index: 998;
    }
    .admin-overlay.open { display: block; }
    .admin-main { padding: 18px 16px; }
    .admin-menu-toggle {
        display: flex; width: 40px; height: 40px; border-radius: 10px;
        align-items: center; justify-content: center; background: var(--surface);
        border: 1px solid var(--border); font-size: 20px; color: var(--ink-700);
    }
}

/* ---- Small phone (≤480px) ---- */
@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .topbar { display: none; } /* reclaim vertical space on very small screens */

    .hero { padding: 30px 0 54px; }
    .hero h1 { font-size: 22px; }
    .hero-eyebrow { font-size: 11px; }
    .hero-search {
        flex-direction: column;
        border-radius: 18px;
        padding: 10px;
        gap: 8px;
    }
    .hero-search select, .hero-search input { width: 100%; padding: 12px 14px; }
    .hero-search select { border-radius: 12px; border: 1.5px solid var(--border); }
    .hero-search button { border-radius: 12px; padding: 13px; width: 100%; }
    .hero-stats { gap: 16px; }
    .hero-stats strong { font-size: 17px; }
    .hero-stats span { font-size: 11px; }

    .quick-actions { grid-template-columns: 1fr 1fr; margin-top: -30px; }
    .cat-grid { grid-template-columns: repeat(2,1fr); }
    .listing-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-grid > div { display: flex; flex-direction: column; align-items: center; }
    .footer-social { justify-content: center; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
    .uploader-grid { grid-template-columns: repeat(3,1fr); gap: 8px; }
    .section-heading h2 { font-size: 18px; }
    .section-heading { flex-wrap: wrap; gap: 8px; }
}

