/* ═══════════════════════════════════════════════════════════════════════
   ReferNex Marketplace — Main Application Styles
   Uses design tokens exclusively from tokens.css
   ═══════════════════════════════════════════════════════════════════════ */

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

html { font-size: var(--font-size-lg); scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-base);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-surface-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--motion-instant) var(--ease-default); }
a:hover { color: var(--color-accent-hover); }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }

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

/* ── Typography ───────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: var(--font-weight-bold); line-height: var(--line-height-tight); color: var(--color-text-primary); }
h1 { font-size: var(--font-size-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--font-size-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-secondary { color: var(--color-text-secondary); }
.text-inverse { color: var(--color-text-inverse); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-center { text-align: center; }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ── Layout ───────────────────────────────────────────────────────────── */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-7); }
.section { padding: var(--space-16) 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-7 { gap: var(--space-7); }

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

/* ── Header / Navigation ──────────────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-subtle);
    height: var(--header-height);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.header-logo { font-size: var(--font-size-xl); font-weight: var(--font-weight-extrabold); color: var(--color-text-primary); display: flex; align-items: center; gap: var(--space-2); }
.header-logo span { color: var(--color-text-inverse); }
.header-nav { display: flex; align-items: center; gap: var(--space-7); }
.header-nav a {
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-xs);
    transition: all var(--motion-instant) var(--ease-default);
}
.header-nav a:hover, .header-nav a.active { color: var(--color-text-primary); background: var(--color-accent-muted); }
.header-actions { display: flex; align-items: center; gap: var(--space-4); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-base);
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--motion-instant) var(--ease-default);
    text-decoration: none;
    white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--color-surface-strong); color: var(--color-text-tertiary); border-color: var(--color-surface-strong); }
.btn-primary:hover { background: var(--color-accent-hover); color: var(--color-text-tertiary); box-shadow: var(--shadow-glow); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary { background: transparent; color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-surface-elevated); border-color: var(--color-text-secondary); }

.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { background: #16a34a; box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); }

.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }

.btn-warning { background: var(--color-warning); color: var(--color-text-tertiary); }
.btn-warning:hover { background: #d97706; }

.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { color: var(--color-text-primary); background: var(--color-surface-elevated); }

.btn-sm { padding: var(--space-1) var(--space-4); font-size: var(--font-size-sm); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--font-size-lg); }
.btn-block { width: 100%; }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-7);
    transition: all var(--motion-fast) var(--ease-default);
}
.card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-card); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--color-border-subtle); }
.card-title { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
.card-body { }
.card-footer { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--color-border-subtle); }

/* ── Stat Cards ───────────────────────────────────────────────────────── */
.stat-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-7);
    transition: all var(--motion-fast) var(--ease-default);
}
.stat-card:hover { border-color: var(--color-border-strong); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: var(--space-4); }
.stat-card .stat-icon.green { background: var(--color-success-muted); color: var(--color-success); }
.stat-card .stat-icon.amber { background: var(--color-warning-muted); color: var(--color-warning); }
.stat-card .stat-icon.blue { background: var(--color-info-muted); color: var(--color-info); }
.stat-card .stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.stat-card .stat-icon.red { background: var(--color-error-muted); color: var(--color-error); }
.stat-card .stat-label { font-size: var(--font-size-sm); color: var(--color-text-secondary); margin-bottom: var(--space-1); }
.stat-card .stat-value { font-size: var(--font-size-2xl); font-weight: var(--font-weight-bold); }
.stat-card .stat-sub { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: var(--space-1); }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-6); }
.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}
.form-label.required::after { content: ' *'; color: var(--color-error); }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xs);
    transition: all var(--motion-instant) var(--ease-default);
    outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--color-text-secondary); opacity: 0.6; }
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--color-border-strong); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-muted); }
.form-input:focus-visible, .form-select:focus-visible, .form-textarea:focus-visible { outline: none; }
.form-input.error, .form-select.error, .form-textarea.error { border-color: var(--color-error); }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled { opacity: 0.5; cursor: not-allowed; }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b96a5' d='M6 8.825L.35 3.175 1.175 2.35 6 7.175 10.825 2.35 11.65 3.175z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-select option { background: var(--color-surface-muted); color: var(--color-text-primary); }

.form-textarea { min-height: 100px; resize: vertical; }
.form-error { font-size: var(--font-size-sm); color: var(--color-error); margin-top: var(--space-1); }
.form-help { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: var(--space-1); }

.form-check { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.form-check input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--color-accent);
    border-radius: 4px; cursor: pointer;
}
.form-check label { font-size: var(--font-size-md); color: var(--color-text-secondary); cursor: pointer; }

/* ── File Upload ──────────────────────────────────────────────────────── */
.file-upload {
    border: 2px dashed var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-10);
    text-align: center;
    cursor: pointer;
    transition: all var(--motion-instant) var(--ease-default);
}
.file-upload:hover { border-color: var(--color-accent); background: var(--color-accent-muted); }
.file-upload.dragover { border-color: var(--color-accent); background: var(--color-accent-muted); }
.file-upload input[type="file"] { display: none; }
.file-upload .upload-icon { font-size: 48px; color: var(--color-text-secondary); margin-bottom: var(--space-4); }
.file-upload .upload-text { font-size: var(--font-size-md); color: var(--color-text-secondary); }
.file-upload .upload-text span { color: var(--color-accent); font-weight: var(--font-weight-semibold); }
.file-upload .upload-hint { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: var(--space-2); }

/* ── Tables ───────────────────────────────────────────────────────────── */
.data-table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border-subtle); }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-md);
}
.data-table th {
    background: var(--color-surface-muted);
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border-subtle);
    white-space: nowrap;
}
.data-table td {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.data-table .actions { display: flex; gap: var(--space-2); }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-success { background: var(--color-success-muted); color: var(--color-success); }
.badge-warning { background: var(--color-warning-muted); color: var(--color-warning); }
.badge-danger { background: var(--color-error-muted); color: var(--color-error); }
.badge-info { background: var(--color-info-muted); color: var(--color-info); }
.badge-secondary { background: rgba(139, 150, 165, 0.15); color: var(--color-text-secondary); }

/* ── Alerts / Flash Messages ──────────────────────────────────────────── */
.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xs);
    font-size: var(--font-size-md);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid transparent;
    animation: slideDown var(--motion-fast) var(--ease-out);
}
.alert-success { background: var(--color-success-muted); color: var(--color-success); border-color: rgba(34,197,94,0.3); }
.alert-error { background: var(--color-error-muted); color: var(--color-error); border-color: rgba(239,68,68,0.3); }
.alert-warning { background: var(--color-warning-muted); color: var(--color-warning); border-color: rgba(245,158,11,0.3); }
.alert-info { background: var(--color-info-muted); color: var(--color-info); border-color: rgba(59,130,246,0.3); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-8); }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 var(--space-3);
    border-radius: var(--radius-xs); font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium); color: var(--color-text-secondary);
    border: 1px solid var(--color-border-subtle);
    transition: all var(--motion-instant) var(--ease-default);
}
.pagination a:hover { background: var(--color-surface-elevated); color: var(--color-text-primary); border-color: var(--color-border-strong); }
.pagination .active { background: var(--color-surface-strong); color: var(--color-text-tertiary); border-color: var(--color-surface-strong); }
.pagination .disabled { opacity: 0.3; pointer-events: none; }

/* ── Hero Section ─────────────────────────────────────────────────────── */
.hero {
    padding: var(--space-16) 0;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(96, 165, 250, 0.12) 0%, transparent 70%);
    position: relative;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(96, 165, 250, 0.06) 0%, transparent 50%);
    pointer-events: none;
}
.hero h1 { margin-bottom: var(--space-5); position: relative; }
.hero p { font-size: var(--font-size-xl); color: var(--color-text-secondary); max-width: 600px; margin: 0 auto var(--space-7); position: relative; }
.hero .rp-badge {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2) var(--space-5); border-radius: var(--radius-full);
    background: var(--color-warning-muted); color: var(--color-warning);
    font-weight: var(--font-weight-semibold); font-size: var(--font-size-md);
    margin-bottom: var(--space-7); position: relative;
}

/* ── Product Grid ─────────────────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-7); }

.product-card {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--motion-fast) var(--ease-default);
    display: flex;
    flex-direction: column;
}
.product-card:hover { border-color: var(--color-border-strong); transform: translateY(-4px); box-shadow: var(--shadow-1); }
.product-card .product-image {
    width: 100%; aspect-ratio: 4/3; object-fit: cover;
    background: var(--color-surface-muted);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-secondary); font-size: 48px;
    overflow: hidden;
}
.product-card .product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--motion-fast) var(--ease-default); }
.product-card:hover .product-image img { transform: scale(1.05); }
.product-card .product-body { padding: var(--space-5); flex: 1; display: flex; flex-direction: column; }
.product-card .product-marketplace { font-size: var(--font-size-xs); color: var(--color-accent); font-weight: var(--font-weight-semibold); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-2); }
.product-card .product-title { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); margin-bottom: var(--space-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .product-price { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-3); }
.product-card .product-price .offer { font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); color: var(--color-text-primary); }
.product-card .product-price .mrp { font-size: var(--font-size-sm); color: var(--color-text-secondary); text-decoration: line-through; }
.product-card .product-rp {
    display: flex; align-items: flex-start; gap: var(--space-1);
    padding: var(--space-1.5) var(--space-3); border-radius: var(--radius-sm);
    background: var(--color-warning-muted); color: var(--color-warning);
    font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold);
    margin-top: auto;
    line-height: 1.35;
    word-break: break-word;
}

/* ── Category Pills ───────────────────────────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-6);
    justify-content: center;
}
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 767px) {
    .category-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}
.category-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-5);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all var(--motion-medium) var(--ease-default);
    position: relative;
    overflow: hidden;
}
@media (max-width: 767px) {
    .category-pill {
        width: 100%;
        padding: 12px 6px;
        gap: 8px;
        border-radius: 12px;
    }
    .category-pill .category-icon-wrapper {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .category-pill span {
        font-size: 11px;
        line-height: 1.25;
    }
}
.category-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--motion-medium) var(--ease-default);
    z-index: 0;
}
.category-pill:hover::before {
    opacity: 1;
}
.category-pill:hover {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(96, 165, 250, 0.1);
}
.category-pill .category-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.12);
    color: var(--color-surface-strong);
    font-size: 26px;
    transition: all var(--motion-medium) var(--ease-default);
    z-index: 1;
}
.category-pill:hover .category-icon-wrapper {
    transform: scale(1.1);
    background: var(--color-surface-strong);
    color: var(--color-text-tertiary);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
    border-color: var(--color-surface-strong);
}
.category-pill span {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    text-align: center;
    z-index: 1;
    transition: color var(--motion-medium) var(--ease-default);
}
.category-pill:hover span {
    color: #ffffff;
}

/* ── Filter Sidebar ───────────────────────────────────────────────────── */
.filter-sidebar { position: sticky; top: calc(var(--header-height) + var(--space-7)); }
.filter-group { margin-bottom: var(--space-6); }
.filter-group h4 { font-size: var(--font-size-md); margin-bottom: var(--space-3); color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Notification Badge ───────────────────────────────────────────────── */
.notif-badge {
    position: relative; display: inline-flex;
}
.notif-badge .count {
    position: absolute; top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    background: var(--color-error);
    color: #fff;
    font-size: 10px; font-weight: var(--font-weight-bold);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal-backdrop);
    display: none; align-items: center; justify-content: center;
    animation: fadeIn var(--motion-instant) var(--ease-out);
}
.modal-backdrop.active { display: flex; }
.modal {
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    max-width: 500px; width: 90%;
    max-height: 90vh; overflow-y: auto;
    animation: scaleIn var(--motion-fast) var(--ease-out);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); }
.modal-close { background: none; border: none; color: var(--color-text-secondary); font-size: 24px; cursor: pointer; padding: var(--space-1); border-radius: var(--radius-xs); }
.modal-close:hover { color: var(--color-text-primary); background: var(--color-surface-elevated); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ── Loading ──────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--color-surface-muted) 25%, var(--color-surface-elevated) 50%, var(--color-surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--color-border-subtle);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: var(--space-8) auto;
}

/* ── Empty State ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: var(--space-16) var(--space-7); }
.empty-state .empty-icon { font-size: 64px; color: var(--color-text-secondary); margin-bottom: var(--space-5); opacity: 0.5; }
.empty-state h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-3); }
.empty-state p { color: var(--color-text-secondary); margin-bottom: var(--space-6); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer {
    background: var(--color-surface-muted);
    border-top: 1px solid var(--color-border-subtle);
    padding: var(--space-10) 0;
    margin-top: var(--space-16);
}
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-5); }
.footer-text { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.footer-links { display: flex; gap: var(--space-6); }
.footer-links a { color: var(--color-text-secondary); font-size: var(--font-size-sm); }
.footer-links a:hover { color: var(--color-text-primary); }

/* ── Utility ──────────────────────────────────────────────────────────── */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-7 { padding: var(--space-7); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   Responsive Styles — Mobile-First
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Mobile Header: Slide-Out Drawer ──────────────────────────────── */
.menu-toggle { display: none; }
@media (max-width: 767px) {
    .menu-toggle { display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--color-text-primary); font-size: 24px; cursor: pointer; padding: var(--space-2); min-width: 44px; min-height: 44px; }
    .header-nav { display: none; }
    .header-actions { display: none; }
}

/* Navigation drawer overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: calc(var(--z-modal-backdrop));
    opacity: 0;
    transition: opacity var(--motion-fast) var(--ease-out);
}
.nav-overlay.active {
    display: block;
    opacity: 1;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: var(--color-surface-card);
    border-right: 1px solid var(--color-border-subtle);
    z-index: calc(var(--z-modal));
    transform: translateX(-100%);
    transition: transform var(--motion-normal) var(--ease-out);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.nav-drawer.active {
    transform: translateX(0);
}
.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5);
    border-bottom: 1px solid var(--color-border-subtle);
    min-height: var(--header-height);
}
.nav-drawer-header .header-logo { font-size: var(--font-size-lg); }
.nav-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: var(--space-2);
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-xs);
}
.nav-drawer-close:hover { color: var(--color-text-primary); background: var(--color-surface-elevated); }
.nav-drawer-body { flex: 1; padding: var(--space-4) 0; }
.nav-drawer-body a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: all var(--motion-instant) var(--ease-default);
    min-height: 44px;
}
.nav-drawer-body a:hover,
.nav-drawer-body a.active {
    color: var(--color-text-primary);
    background: var(--color-accent-muted);
}
.nav-drawer-body a i { width: 22px; text-align: center; font-size: 18px; }
.nav-drawer-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border-subtle);
}
.nav-drawer-footer .btn { width: 100%; justify-content: center; margin-bottom: var(--space-2); min-height: 44px; }
.nav-drawer-footer .btn:last-child { margin-bottom: 0; }

/* ── Responsive Product Grid ───────────────────────────────────────── */
@media (max-width: 1100px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
}

/* ── Responsive Typography ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    h1 { font-size: var(--font-size-2xl); }
}

/* ── Responsive Hero ────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .hero { padding: var(--space-8) 0; }
    .hero h1 { font-size: clamp(24px, 7vw, 36px); }
    .hero p { font-size: var(--font-size-md); }
}

/* ── Responsive Footer ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

/* ── Responsive Buttons (touch-friendly) ───────────────────────────── */
@media (max-width: 767px) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .btn-lg { min-height: 48px; }
    .btn-block-mobile { width: 100%; justify-content: center; }
}

/* ── Form Grid (2 cols desktop, 1 col mobile) ──────────────────────── */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
}
@media (max-width: 767px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ── Content Grid (multi-col desktop, 1 col mobile) ──────────────── */
.content-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
    align-items: start;
}
.content-grid-3-2 {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-7);
    align-items: start;
}
.content-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-7);
    align-items: start;
}
@media (max-width: 767px) {
    .content-grid-2,
    .content-grid-3-2,
    .content-grid-2-1 { grid-template-columns: 1fr; }
}

/* ── Responsive Forms ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .form-input, .form-select, .form-textarea {
        padding: var(--space-4) var(--space-5);
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    .form-label { font-size: var(--font-size-md); }
    .form-group { margin-bottom: var(--space-5); }
    .form-check { min-height: 44px; }
    .form-check input[type="checkbox"] { width: 22px; height: 22px; }
    .file-upload { padding: var(--space-7); }
    .file-upload .upload-icon { font-size: 36px; }
}

/* ── Responsive Stat Cards ─────────────────────────────────────────── */
@media (max-width: 767px) {
    .stat-card .stat-value { font-size: var(--font-size-xl); }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 20px; }
}

/* ── Responsive Tables → Card Layout ───────────────────────────────── */
@media (max-width: 767px) {
    .data-table-wrapper {
        overflow: visible;
        border: none;
        border-radius: 0;
        background: transparent;
    }
    .data-table-wrapper .data-table { display: none; }


    .data-table-card {
        display: block;
        background: var(--color-surface-card);
        border: 1px solid var(--color-border-subtle);
        border-radius: var(--radius-md);
        padding: var(--space-5);
        margin-bottom: var(--space-4);
        box-shadow: var(--shadow-card);
    }
    .data-table-card:last-child { margin-bottom: 0; }
    .data-table-card .dtc-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-2) 0;
        border-bottom: 1px solid var(--color-border-subtle);
        gap: var(--space-3);
    }
    .data-table-card .dtc-row:last-child { border-bottom: none; }
    .data-table-card .dtc-label {
        font-size: var(--font-size-xs);
        color: var(--color-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        flex-shrink: 0;
    }
    .data-table-card .dtc-value {
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-medium);
        color: var(--color-text-primary);
        text-align: right;
        word-break: break-word;
    }
    .data-table-card .dtc-value .badge { font-size: 10px; }
    .data-table-card .dtc-actions {
        display: flex;
        gap: var(--space-3);
        margin-top: var(--space-3);
        padding-top: var(--space-3);
        border-top: 1px solid var(--color-border-subtle);
    }
    .data-table-card .dtc-actions .btn {
        flex: 1;
        justify-content: center;
        font-size: var(--font-size-sm);
    }

    .pagination { flex-wrap: wrap; gap: var(--space-2); }
    .pagination a, .pagination span { min-width: 36px; height: 36px; font-size: var(--font-size-sm); }
}

/* ── Responsive Cards ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .card { padding: var(--space-5); }
    .card-header { flex-direction: column; gap: var(--space-3); align-items: flex-start; }
    .card-title { font-size: var(--font-size-lg); }
}

/* ── Responsive Flex Header (dashboard header action row) ─────────── */
@media (max-width: 767px) {
    .dashboard-header .flex.justify-between,
    .dashboard-header > .flex {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start !important;
    }
    .dashboard-header .flex.justify-between .btn,
    .dashboard-header > .flex .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Responsive Modal ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .modal { width: 95%; padding: var(--space-6); margin: var(--space-4); }
}

/* ── Responsive Category Grid ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    /* category-grid is already set to flex horizontal scroll at line 403 */
    .category-pill .category-icon-wrapper { width: 48px; height: 48px; font-size: 20px; }
    .category-pill span { font-size: var(--font-size-sm); }
}

/* ── Responsive Partner Grid ───────────────────────────────────────── */
@media (max-width: 1024px) {
    .partner-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .partner-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
}

/* ── Responsive Bento Grid ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: 1fr; }
    .bento-col-2 { grid-column: span 1; }
}

/* ── Responsive Trust Stats ────────────────────────────────────────── */
@media (max-width: 767px) {
    .trust-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
}
@media (max-width: 480px) {
    .trust-grid { grid-template-columns: 1fr; }
}

/* ── Responsive Empty State ────────────────────────────────────────── */
@media (max-width: 767px) {
    .empty-state { padding: var(--space-8) var(--space-5); }
    .empty-state .empty-icon { font-size: 48px; }
}

/* ── Responsive Alerts ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .alert { padding: var(--space-3) var(--space-4); font-size: var(--font-size-sm); }
}

/* ── Responsive Filter Bars ────────────────────────────────────────── */
@media (max-width: 767px) {
    .filter-bar {
        flex-direction: column;
        gap: var(--space-3);
    }
    .filter-bar .form-input,
    .filter-bar .form-select {
        width: 100%;
        max-width: 100% !important;
    }
    .filter-bar .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Responsive Filter Pills ────────────────────────────────────────── */
@media (max-width: 767px) {
    .filter-pills { gap: 6px; }
    .filter-pill { padding: 6px 14px; font-size: 12px; }
}

/* ── Responsive Detail Grid ─────────────────────────────────────────── */
@media (max-width: 767px) {
    .detail-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* ── Responsive Invoice Preview ────────────────────────────────────── */
@media (max-width: 767px) {
    .invoice-preview img { width: 100%; height: auto; }
}

/* ── Responsive Report Filters ──────────────────────────────────────── */
@media (max-width: 767px) {
    .report-filters { flex-direction: column; gap: var(--space-3); }
    .report-filters .form-group { min-width: 100%; }
}

/* ── Responsive Review Actions ──────────────────────────────────────── */
@media (max-width: 767px) {
    .review-actions { flex-direction: column; }
    .review-actions .btn { width: 100%; justify-content: center; }
}

/* ── Prevent horizontal scroll on all breakpoints ──────────────────── */
html { overflow-x: hidden; }
body { overflow-x: hidden; }


/* ── Premium UI Enhancements (Stitch MCP Integration) ────────────────── */
.glass-card-premium {
    background: rgba(15, 20, 30, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-7);
    transition: all var(--motion-fast) var(--ease-default);
}
.glass-card-premium:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 0 25px rgba(96, 165, 250, 0.12);
    transform: translateY(-4px);
}
.glow-glow-blue {
    background: radial-gradient(circle at center, rgba(96, 165, 250, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}
.btn-premium-gold {
    background: var(--color-warning);
    border: 1px solid var(--color-warning);
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-bold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all var(--motion-fast) var(--ease-default);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-premium-gold:hover {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
    filter: brightness(1.1);
    color: var(--color-text-tertiary);
}
.btn-premium-gold:active {
    transform: translateY(0) scale(0.98);
}
.btn-premium-blue {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-surface-strong);
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-bold);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all var(--motion-fast) var(--ease-default);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-premium-blue:hover {
    box-shadow: 0 0 25px rgba(96, 165, 250, 0.4);
    transform: translateY(-2px);
    filter: brightness(1.1);
    color: var(--color-text-tertiary);
}
.btn-premium-blue:active {
    transform: translateY(0) scale(0.98);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-7);
}
.bento-col-2 {
    grid-column: span 2;
}
@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-col-2 {
        grid-column: span 1;
    }
}

/* Avatar Group */
.avatar-group {
    display: flex;
    align-items: center;
}
.avatar-group .avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-surface-base);
    margin-left: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    color: #fff;
    overflow: hidden;
}
.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* Partner Store Cards */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-6);
}
@media (max-width: 1024px) {
    .partner-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 576px) {
    .partner-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.partner-card {
    background: rgba(15, 20, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    text-align: center;
    cursor: pointer;
    transition: all var(--motion-fast) var(--ease-default);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
.partner-card:hover {
    transform: translateY(-4px);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 0 25px rgba(96, 165, 250, 0.12);
    background: rgba(20, 26, 40, 0.7);
}
.partner-logo-container {
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: var(--radius-md);
    margin: 0 auto var(--space-4) auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    transition: transform var(--motion-fast) var(--ease-default);
}
.partner-card:hover .partner-logo-container {
    transform: scale(1.1);
}

/* Portfolio Preview Card */
.portfolio-card {
    background: rgba(15, 20, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-7);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-glow);
}
.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}
.portfolio-live-sync {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.portfolio-live-sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-success);
    animation: blink 1.5s infinite ease-in-out;
}
@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.portfolio-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}
.portfolio-stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-4);
    border-radius: var(--radius-md);
}
.portfolio-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.portfolio-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    transition: all var(--motion-fast) var(--ease-default);
}
.portfolio-list-item:hover {
    border-color: rgba(96, 165, 250, 0.25);
    background: rgba(255, 255, 255, 0.05);
}
.portfolio-logo-mini {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    overflow: hidden;
}

/* Trust stats */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    text-align: center;
}
@media (max-width: 768px) {
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .trust-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Marketplace Grid & Card Layout (Shared) ─────────────────────────── */
.marketplace-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}
@media (max-width: 768px) {
    .marketplace-container {
        padding: 20px 12px;
    }
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 1100px) { .marketplace-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .marketplace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.marketplace-card {
    background: #0d1117;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 25px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
    box-sizing: border-box;
}
.marketplace-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
}

/* Badge row */
.badge-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    min-height: 24px;
}
.rp-badge-corner {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    display: inline-block;
    text-align: center;
    letter-spacing: 0.3px;
    white-space: normal;
    line-height: 1.4;
}
.rp-badge-corner i {
    margin-right: 4px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Logo container */
.logo-container {
    width: 130px;
    height: 130px;
    border-radius: 16px;
    background: #161b26;
    border: 2px solid transparent;
    background-image: linear-gradient(#161b26, #161b26), linear-gradient(135deg, #60a5fa, #a855f7);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 25px rgba(96, 165, 250, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.marketplace-card:hover .logo-container {
    transform: scale(1.05);
    box-shadow: 0 12px 30px rgba(96, 165, 250, 0.25);
}
.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.logo-container .placeholder-icon {
    font-size: 36px;
    opacity: 0.25;
    color: #fff;
}

/* Store name */
.store-name {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin: 8px 0 0 0;
    line-height: 1.25;
}

/* Reward Container */
.reward-container {
    width: 100%;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-radius: 12px;
    padding: 8px 10px;
    margin: 12px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.reward-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 700;
    color: rgba(34, 197, 94, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.reward-amount {
    font-size: 18px;
    font-weight: 800;
    color: #22c55e;
    line-height: 1.2;
}
.reward-desc {
    font-size: 9px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CTA button */
.btn-shop-now {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}
.btn-shop-now:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.45);
    filter: brightness(1.15);
}

/* Secondary actions row */
.secondary-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
}
.btn-share, .btn-copy-link {
    flex: 1;
    height: 32px;
    border-radius: 8px;
    background: #161b22;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-share:hover, .btn-copy-link:hover {
    background: #21262d;
    border-color: rgba(255,255,255,0.15);
    color: #fff;
}

/* Category filter pills */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}
.filter-pill {
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.08);
}
.filter-pill:hover {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.2);
}
.filter-pill.active {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .marketplace-grid {
        gap: 12px;
    }
    .marketplace-card {
        padding: 12px;
        border-radius: 12px;
    }
    .badge-row {
        margin-bottom: 8px;
        min-height: 20px;
    }
    .rp-badge-corner {
        font-size: 8.5px;
        padding: 3px 8px;
        letter-spacing: 0.1px;
    }
    .logo-container {
        width: 100px;
        height: 100px;
        border-radius: 12px;
    }
    .store-name {
        font-size: 14px;
        margin-top: 6px;
    }
    .reward-container {
        padding: 6px 8px;
        margin: 8px 0;
        border-radius: 8px;
    }
    .reward-label {
        font-size: 8px;
        letter-spacing: 0.4px;
    }
    .reward-amount {
        font-size: 14px;
    }
    .btn-shop-now {
        height: 32px;
        font-size: 11px;
        border-radius: 6px;
    }
    .secondary-actions {
        gap: 6px;
        margin-top: 6px;
    }
    .btn-share, .btn-copy-link {
        font-size: 9.5px;
        height: 28px;
        padding: 0 4px;
        border-radius: 6px;
    }
    .filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 16px;
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filter-pills::-webkit-scrollbar {
        display: none;
    }
    .filter-pill {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 12px;
    }
}

/* ── Responsive Admin Split Grid & Deal Show Padding ── */
.admin-split-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-7);
    align-items: start;
}
.deal-show-container {
    padding: var(--space-10) 0;
}
.deal-show-card-body {
    padding: var(--space-8);
}
@media (max-width: 767px) {
    .admin-split-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
    .deal-show-container {
        padding: var(--space-5) 0;
    }
    .deal-show-card-body {
        padding: var(--space-5);
    }
    .flex-mobile-col {
        flex-direction: column !important;
        width: 100%;
    }
    .flex-mobile-col .btn,
    .flex-mobile-col a.btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ── Inline Detail Tables (admin withdrawal/claim review) ──────────── */
@media (max-width: 767px) {
    .data-table:not(.data-table-wrapper .data-table) td {
        font-size: var(--font-size-sm);
        padding: 6px 0;
        word-break: break-word;
    }
    .data-table:not(.data-table-wrapper .data-table) {
        font-size: var(--font-size-sm);
    }
}

/* ── Marketplace Page Title ────────────────────────────────────────── */
.page-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-extrabold);
    color: #fff;
    margin-bottom: 6px;
}
.page-subtitle {
    color: rgba(255,255,255,0.5);
    font-size: var(--font-size-md);
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    .page-title {
        font-size: var(--font-size-2xl);
    }
    .page-subtitle {
        font-size: var(--font-size-sm);
    }
}

/* ── Deal Show Page Responsive ─────────────────────────────────────── */
@media (max-width: 767px) {
    .deal-show-card-body h1 {
        font-size: var(--font-size-xl) !important;
    }
}

/* ── Global Overflow Prevention ────────────────────────────────────── */
.reward-amount,
.rp-badge-corner,
.store-name {
    overflow-wrap: break-word;
    word-break: break-word;
}


/* ── How It Works Mobile 2x2 Grid Layout ───────────────────────────── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
}

.steps-grid a.step-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    height: 100%;
}

.steps-grid a.step-card:hover {
    color: inherit;
    text-decoration: none;
}

.steps-grid .step-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: var(--space-4);
}

.steps-grid .step-1-color {
    background: rgba(96, 165, 250, 0.1);
    color: var(--color-surface-strong);
}

.steps-grid .step-2-color {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.steps-grid .step-3-color {
    background: rgba(96, 165, 250, 0.1);
    color: var(--color-surface-strong);
}

.steps-grid .step-4-color {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.steps-grid .step-number {
    font-size: var(--font-size-xs);
    font-weight: bold;
    margin-bottom: 2px;
}

.steps-grid .step-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
}

.steps-grid .step-desc {
    line-height: 1.5;
    margin: 0;
}

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

@media (max-width: 767px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .steps-grid a.step-card {
        padding: var(--space-4) !important;
    }
    
    .steps-grid .step-icon-wrapper {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        margin-bottom: var(--space-3);
    }
    
    .steps-grid .step-number {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .steps-grid .step-title {
        font-size: var(--font-size-md);
        margin-bottom: var(--space-1);
    }
    
    .steps-grid .step-desc {
        font-size: 12px;
        line-height: 1.4;
    }
}

@media (max-width: 319px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}


/* ── Category Dropdown Filter for Mobile ────────────────────────────── */
.category-dropdown-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    z-index: 100;
}

.category-dropdown-btn {
    height: 46px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-5);
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xs);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all var(--motion-instant) var(--ease-default);
    text-align: left;
}

.category-dropdown-btn:hover,
.category-dropdown-btn:focus {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.1);
    outline: none;
}

.category-dropdown-btn .arrow-icon {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    transition: transform var(--motion-fast) var(--ease-default);
}

.category-dropdown-btn[aria-expanded="true"] .arrow-icon {
    transform: rotate(180deg);
}

.category-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #0f141e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xs);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-height: 320px;
    display: flex;
    flex-direction: column;
}

.category-dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-search-wrapper {
    position: relative;
    padding: 12px 16px 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-search-wrapper .search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-secondary);
    font-size: 14px;
}

.dropdown-search-input {
    height: 38px;
    width: 100%;
    padding: 0 12px 0 36px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
}

.dropdown-search-input:focus {
    border-color: var(--color-accent);
    outline: none;
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-options-list {
    overflow-y: auto;
    padding: 8px;
    flex-grow: 1;
}

.dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--motion-instant) var(--ease-default);
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.dropdown-option.active {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    font-weight: 600;
}

.dropdown-option .category-count {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    transition: all var(--motion-instant) var(--ease-default);
}

.dropdown-option.active .category-count {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

@media (min-width: 768px) {
    .category-dropdown-container {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .filter-pills {
        display: none !important;
    }
}

