:root {
    --bg: #07111f;
    --ink: #0f172a;
    --muted: #64748b;
    --white: #fff;
    --green: #047857;
    --green2: #16a34a;
    --gold: #f59e0b;
    --blue: #2563eb;
    --red: #dc2626;
    --shadow: 0 16px 38px rgba(15, 23, 42, .16);
    --radius: 22px;
}

/*
|--------------------------------------------------------------------------
| Base Styles
|--------------------------------------------------------------------------
*/

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: #eaf2ff;
    line-height: 1.7;
    background:
        radial-gradient(circle at top left, rgba(22, 163, 74, .25), transparent 32%),
        linear-gradient(135deg, #07111f, #0f3b2e 45%, #7c2d12);
}

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

a {
    color: #047857;
    text-decoration: none;
    font-weight: 800;
}

/*
|--------------------------------------------------------------------------
| Header & Navigation
|--------------------------------------------------------------------------
*/

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(7, 17, 31, .9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.navbar {
    max-width: 1320px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.nav-left,
.nav-right,
.auth-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
}

.brand-text {
    white-space: nowrap;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.nav-list a {
    display: inline-flex;
    padding: 10px 13px;
    border-radius: 12px;
    color: #e5eefc;
}

.nav-list a:hover,
.nav-list a.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.auth-links a {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
}

.signup-btn {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    color: #111827 !important;
}

/*
|--------------------------------------------------------------------------
| Mobile Menu Buttons & Overlay
|--------------------------------------------------------------------------
*/

.menu-toggle,
.menu-close {
    width: 28px;
    height: 28px;
}

.menu-toggle-btn,
.menu-close-btn {
    background: none;
    border: 0;
}

.nav-close-wrap {
    display: none;
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .58);
    opacity: 0;
    visibility: hidden;
    z-index: 900;
}

.nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/*
|--------------------------------------------------------------------------
| Main Layout
|--------------------------------------------------------------------------
*/

.page-main {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 20px 54px;
}

.hero-section,
.listing-detail-hero,
.section-card,
.filter-card,
.form-card,
.listing-summary,
.success-card,
.empty-state,
.admin-hero,
.admin-card,
.stat-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/*
|--------------------------------------------------------------------------
| Hero Sections
|--------------------------------------------------------------------------
*/

.hero-section {
    padding: 34px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, .16),
        rgba(255, 255, 255, .06)
    );
    border: 1px solid rgba(255, 255, 255, .18);
    margin-bottom: 22px;
}

.small-hero h1,
.catalogue-hero h1,
.hero-section h1 {
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(1.8rem, 4vw, 3.4rem);
    line-height: 1.1;
}

.hero-kicker {
    margin: 0 0 8px;
    color: #fde68a;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    font-weight: 900;
}

.hero-subtext {
    max-width: 900px;
    color: #f8fafc;
}

.hero-actions,
.contact-actions,
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/*
|--------------------------------------------------------------------------
| Buttons & Action Links
|--------------------------------------------------------------------------
*/

.cta-link,
.submit-btn,
.filter-form button,
.admin-update-form button,
.contact-actions a,
.admin-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 13px;
    background: linear-gradient(90deg, #047857, #16a34a, #f59e0b);
    color: #fff !important;
    border: 0;
    font-weight: 900;
    cursor: pointer;
}

.secondary-link {
    background: #fff !important;
    color: #14532d !important;
}

.ghost-link {
    background: rgba(255, 255, 255, .1) !important;
    border: 1px solid rgba(255, 255, 255, .25) !important;
}

.full {
    width: 100%;
}

/*
|--------------------------------------------------------------------------
| Listing Detail Page
|--------------------------------------------------------------------------
*/

.listing-detail-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    padding: 24px;
    background: #fff;
    color: #111827;
    margin-bottom: 24px;
}

.gallery-panel,
.detail-panel {
    min-width: 0;
}

.main-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 18px;
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 900;
    border-radius: 18px;
}

.image-placeholder.large {
    height: 420px;
}

.thumb-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.thumb-row img {
    height: 82px;
    object-fit: cover;
    border-radius: 12px;
}

.detail-panel h1 {
    margin: 0 0 10px;
    color: #111827;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.detail-short {
    color: #475569;
}

.price-box {
    padding: 14px 16px;
    border-radius: 14px;
    background: #ecfdf5;
    color: #14532d;
    font-weight: 900;
    font-size: 1.2rem;
    margin: 16px 0;
}

/*
|--------------------------------------------------------------------------
| Information Grids
|--------------------------------------------------------------------------
*/

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.info-grid div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
}

.info-grid span {
    display: block;
    color: #64748b;
    font-size: .82rem;
}

.info-grid strong {
    color: #111827;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.4fr .6fr;
    gap: 20px;
}

.section-card {
    background: #fff;
    color: #111827;
    padding: 24px;
}

.section-card h2 {
    margin-top: 0;
}

/*
|--------------------------------------------------------------------------
| Buyer Request Layout
|--------------------------------------------------------------------------
*/

.request-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
}

.listing-summary,
.form-card {
    background: #fff;
    color: #111827;
    padding: 22px;
}

.listing-summary img {
    border-radius: 16px;
    margin-bottom: 14px;
}

.summary-line {
    margin: 8px 0;
    color: #475569;
}

.secondary-text-link {
    display: inline-block;
    margin-top: 12px;
}

/*
|--------------------------------------------------------------------------
| Forms
|--------------------------------------------------------------------------
*/

.market-form label {
    font-weight: 800;
    color: #111827;
}

.form-grid {
    display: grid;
    gap: 14px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.declaration,
.inline-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
    color: #334155;
}

.declaration input,
.inline-check input {
    width: auto;
    margin-top: 6px;
}

/*
|--------------------------------------------------------------------------
| Alerts, Success & Empty States
|--------------------------------------------------------------------------
*/

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin: 0 0 18px;
    font-weight: 700;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success,
.success-card {
    background: #dcfce7;
    color: #14532d;
}

.big-code {
    font-size: 1.4rem;
    font-weight: 900;
    background: #fff;
    border: 1px dashed #16a34a;
    border-radius: 14px;
    padding: 14px;
    margin: 12px 0;
}

/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
*/

.filter-form {
    display: grid;
    grid-template-columns: 1fr 220px 160px;
    gap: 12px;
}

/*
|--------------------------------------------------------------------------
| Catalogue Grid
|--------------------------------------------------------------------------
*/

.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.catalogue-card {
    background: #fff;
    color: #111827;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.catalogue-image {
    height: 220px;
    position: relative;
    background: #f1f5f9;
}

.catalogue-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #f59e0b;
    color: #111827;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 900;
}

.catalogue-content {
    padding: 18px;
}

.catalogue-meta,
.vendor-line,
.location-line,
.meta {
    color: #64748b;
    font-size: .92rem;
}

.price-line {
    font-size: 1.05rem;
    color: #14532d;
    font-weight: 900;
    margin: 10px 0;
}

/*
|--------------------------------------------------------------------------
| Admin Area
|--------------------------------------------------------------------------
*/

.admin-body {
    background: #f1f5f9;
    color: #111827;
}

.admin-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
}

.admin-hero {
    background: #0f172a;
    color: #fff;
    padding: 26px;
    margin-bottom: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    background: #fff;
    padding: 16px;
}

.stat-card span {
    display: block;
    color: #64748b;
}

.stat-card strong {
    font-size: 1.5rem;
}

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

.admin-card {
    background: #fff;
    padding: 20px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

/*
|--------------------------------------------------------------------------
| Status Badges
|--------------------------------------------------------------------------
*/

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 900;
}

.badge.new {
    background: #dbeafe;
    color: #1e40af;
}

.badge.review {
    background: #fef3c7;
    color: #92400e;
}

.badge.forwarded {
    background: #e0e7ff;
    color: #3730a3;
}

.badge.approved {
    background: #dcfce7;
    color: #166534;
}

.badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.badge.closed {
    background: #e5e7eb;
    color: #374151;
}

/*
|--------------------------------------------------------------------------
| Message & Admin Forms
|--------------------------------------------------------------------------
*/

.message-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    margin: 14px 0;
}

.admin-update-form {
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
    margin-top: 14px;
}

/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.site-footer {
    text-align: center;
    padding: 24px;
    color: #fef3c7;
}

/*
|--------------------------------------------------------------------------
| Responsive Styles
|--------------------------------------------------------------------------
*/

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

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

@media (max-width: 920px) {
    .brand-text,
    .nav-right {
        display: none;
    }

    .nav-list {
        position: fixed;
        top: 0;
        left: -100%;
        width: 310px;
        max-width: 86vw;
        height: 100vh;
        background: #0f172a;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 8px;
        box-shadow: var(--shadow);
        transition: left .25s;
        overflow-y: auto;
        z-index: 1001;
    }

    .nav-list.is-open {
        left: 0;
    }

    .nav-list li,
    .nav-list a {
        width: 100%;
    }

    .nav-close-wrap {
        display: block;
        width: 100%;
        text-align: right;
    }

    .listing-detail-hero,
    .content-grid,
    .request-layout {
        grid-template-columns: 1fr;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .form-grid.two {
        grid-template-columns: 1fr;
    }

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

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

    .main-image,
    .image-placeholder.large {
        height: 280px;
    }

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

@media (min-width: 921px) {
    .menu-toggle-btn,
    .menu-close-btn {
        display: none;
    }

    .nav-overlay {
        display: none !important;
    }
}