/* ===================== ROOT VARIABLES — dark-blue / teal system ===================== */
:root {
  --navy-950: #0b1626;
  --navy-900: #0f1f35;
  --navy-800: #16304f;
  --navy-700: #1e3f66;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-600: #0d9488;
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-alt: #eef2f6;
  --text: #142033;
  --text-muted: #5b6b81;
  --border: #dde3ea;
  --danger: #e5484d;
  --success: #14b8a6;
  --warning: #b45309;
  --shadow: 0 4px 16px rgba(15,31,53,0.08);
  --shadow-lg: 0 14px 40px rgba(15,31,53,0.2);
  --radius: 12px;
  --radius-lg: 18px;
  --transition: 0.22s ease;
  --header-h: 68px;
}

[data-theme="dark"] {
  --bg: var(--navy-950);
  --surface: var(--navy-900);
  --surface-alt: var(--navy-800);
  --text: #eef3f8;
  --text-muted: #96a5ba;
  --border: #24364f;
  --shadow: 0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh; overflow-x: hidden;
}
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 620px; }
.hidden { display: none !important; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
.link-btn { background: none; border: none; color: var(--teal-600); font-weight: 600; cursor: pointer; text-decoration: none; font-size: 0.85rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ===================== BUTTONS ===================== */
.btn { padding: 10px 18px; border: none; border-radius: 30px; cursor: pointer; font-weight: 600; font-size: 0.88rem; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--teal-500), var(--teal-600)); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20,184,166,0.4); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: transparent; color: var(--teal-600); border: 1.5px solid var(--teal-500); }
.btn-outline:hover { background: rgba(20,184,166,0.08); }
.btn-ghost { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(229,72,77,0.4); }
.btn-block { width: 100%; margin-top: 10px; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 13px 26px; font-size: 0.95rem; }

.icon-btn {
  background: var(--surface-alt); border: none; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; font-size: 1.05rem; display: flex; align-items: center; justify-content: center;
  position: relative; transition: background var(--transition); color: var(--text);
}
.icon-btn:hover { background: var(--border); }
.badge {
  position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff;
  font-size: 0.6rem; padding: 2px 5px; border-radius: 50%; min-width: 15px; text-align: center;
}

/* ===================== DEMO BANNER ===================== */
.demo-banner {
  background: var(--navy-900); color: #cfe9e5; font-size: 0.78rem; text-align: center;
  padding: 8px 36px; position: relative;
}
.demo-banner button { background: var(--teal-500); color: #fff; border: none; padding: 4px 12px; border-radius: 14px; margin-left: 10px; cursor: pointer; font-size: 0.72rem; }
#demoBannerClose { position: absolute; right: 8px; top: 6px; background: transparent; color: #cfe9e5; font-size: 1.1rem; }
@media (max-width: 480px) {
  .demo-banner { padding: 8px 30px; font-size: 0.72rem; }
  .demo-banner button { margin: 4px 4px 0; }
}

/* ===================== HEADER ===================== */
.site-header { position: sticky; top: 0; z-index: 500; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.header-inner {
  min-height: var(--header-h); display: flex; align-items: center; gap: 14px;
  padding: 8px 20px; max-width: 1400px; margin: 0 auto; flex-wrap: nowrap;
}
.logo {
  font-size: clamp(1.05rem, 3.6vw, 1.35rem); font-weight: 800; color: var(--navy-800);
  text-decoration: none; display: flex; flex-direction: column; line-height: 1;
  flex-shrink: 0; white-space: nowrap;
}
[data-theme="dark"] .logo { color: #fff; }
.logo .tagline { font-size: 0.55rem; letter-spacing: 1.5px; color: var(--teal-500); font-weight: 700; margin-top: 2px; }

.main-nav { display: flex; gap: 20px; flex-shrink: 0; }
.main-nav a { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: color var(--transition); }
.main-nav a:hover, .main-nav a.active { color: var(--teal-600); }

.header-search { display: flex; flex: 1; min-width: 0; max-width: 340px; border: 1px solid var(--border); border-radius: 24px; overflow: hidden; background: var(--surface-alt); }
.header-search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 9px 14px; outline: none; color: var(--text); font-size: 0.85rem; }
.header-search button { border: none; background: transparent; padding: 0 14px; cursor: pointer; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.dropdown-wrap { position: relative; }
.post-btn { display: none; }
@media (min-width: 640px) { .post-btn { display: inline-block; } }

/* Icons that live in the mobile drawer instead of the header row below 640px */
@media (max-width: 639px) {
  #favIconBtn, #msgIconBtn { display: none; }
}

.dropdown {
  position: absolute; top: 115%; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; overflow: hidden; z-index: 200;
  animation: fadeSlide 0.2s ease;
}
.dropdown button, .dropdown a {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px;
  background: none; border: none; border-radius: 8px; cursor: pointer; color: var(--text);
  font-size: 0.88rem; font-weight: 500; text-decoration: none; transition: all 0.2s ease;
}
.dropdown button:hover, .dropdown a:hover {
  background: var(--surface-alt);
  color: var(--teal-600);
}
.dropdown button#logoutBtn {
  color: var(--danger);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  border-radius: 0 0 8px 8px;
}
.dropdown button#logoutBtn:hover {
  background: rgba(229, 72, 77, 0.08);
  color: var(--danger);
}
.notif-dropdown { width: min(300px, calc(100vw - 24px)); max-height: 380px; overflow-y: auto; }
.dropdown { max-width: calc(100vw - 24px); }
.dropdown-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-weight: 700; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.notif-list { padding: 6px 0; }
.notif-item { padding: 10px 16px; font-size: 0.8rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.notif-item.unread { background: rgba(20,184,166,0.08); color: var(--text); font-weight: 600; }
.notif-empty { padding: 20px; text-align: center; font-size: 0.8rem; color: var(--text-muted); }

.guest-actions { display: flex; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; background: var(--surface-alt); border: none; padding: 5px 12px 5px 5px; border-radius: 30px; cursor: pointer; color: var(--text); font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--teal-500), var(--navy-700)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }
.avatar.has-image, .profile-avatar-lg.has-image, .profile-avatar-md.has-image { color: transparent; }

.mobile-search { display: flex; padding: 10px 16px 14px; gap: 8px; }
.mobile-search input { flex: 1; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); outline: none; }

.desktop-only { display: none; }
.mobile-only { display: flex; }
@media (min-width: 900px) {
  .desktop-only { display: flex; }
  .mobile-only { display: none; }
}

/* ===================== HEADER — SMALL SCREEN TIGHTENING ===================== */
@media (max-width: 899px) {
  .header-inner { gap: 8px; padding: 8px 14px; }
  .header-actions { gap: 4px; }
  .icon-btn { width: 36px; height: 36px; font-size: 0.95rem; }
}
@media (max-width: 639px) {
  .logo .tagline { display: none; }
  .guest-actions .btn { padding: 8px 12px; font-size: 0.8rem; }
}
@media (max-width: 399px) {
  .header-inner { gap: 6px; padding: 6px 10px; }
  .icon-btn { width: 32px; height: 32px; font-size: 0.85rem; }
  .guest-actions #signupBtn { display: none; }
  .guest-actions #loginBtn { padding: 8px 10px; font-size: 0.76rem; }
}

/* ===================== MOBILE DRAWER ===================== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 600; }
.mobile-drawer {
  position: fixed; top: 0; left: 0; height: 100vh; width: 280px; background: var(--surface);
  z-index: 700; transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-nav { display: flex; flex-direction: column; padding: 10px 0; flex: 1; overflow-y: auto; }
.drawer-nav a { padding: 13px 20px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.92rem; border-bottom: 1px solid var(--border); }
.drawer-nav a:hover { background: var(--surface-alt); }
.drawer-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

/* ===================== HERO ===================== */
.hero { background: linear-gradient(135deg, var(--navy-900), var(--navy-800)); padding: 56px 0 44px; text-align: center; color: #fff; }
.hero-inner h1 { font-size: clamp(1.6rem, 4.2vw, 2.6rem); font-weight: 800; line-height: 1.25; margin-bottom: 24px; }
.hero-inner h1 span { color: var(--teal-400); }
.search-bar { display: flex; max-width: 640px; margin: 0 auto 24px; background: var(--surface); border-radius: 40px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-bar input { flex: 1; border: none; padding: 14px 18px; font-size: 0.95rem; outline: none; background: var(--surface); color: var(--text); min-width: 0; }
.search-bar .btn { border-radius: 0; padding: 14px 26px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-ctas .btn-outline { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero-ctas .btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ===================== HOME SECTIONS ===================== */
.home-section { padding: 40px 0 8px; }
.home-section h2 { font-size: 1.35rem; margin-bottom: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-head h2 { margin-bottom: 0; }

.popular-categories-section {
  background-color: var(--surface-alt);
  padding: 35px 20px;
  border-radius: var(--radius-lg);
  margin: 30px 0;
  box-shadow: var(--shadow);
}

.section-header-modern {
  margin-bottom: 20px;
}

.section-header-modern h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
}

.cat-card:hover {
  transform: translateY(-5px);
  border-color: var(--teal-500);
  box-shadow: var(--shadow-lg);
  color: var(--teal-600);
}

.cat-card .cat-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.cat-card .cat-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.steps-grid, .trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.step-card, .trust-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.step-card span, .trust-card { font-size: 1.6rem; }
.step-card h4, .trust-card h4 { margin: 10px 0 6px; font-size: 0.95rem; }
.step-card p, .trust-card p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.how-works, .trust-section { padding-bottom: 40px; }

/* ===================== FILTERS ===================== */
.view-title { padding: 28px 0 16px; font-size: 1.6rem; }
.sub-title { margin: 24px 0 14px; font-size: 1.1rem; }
.filters-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-bottom: 20px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.chip { padding: 8px 15px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 0.82rem; font-weight: 500; transition: all var(--transition); color: var(--text); }
.chip.active { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }
.price-filter { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--text-muted); min-width: 170px; }
.price-filter input[type=range] { accent-color: var(--teal-600); margin-top: 4px; }
#conditionFilter, #buySort, #hireSort { padding: 8px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.82rem; }

/* ===================== GRID / CARDS ===================== */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; padding-bottom: 20px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 0; }

.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); border: 1px solid var(--border); display: flex; flex-direction: column; animation: fadeSlide 0.3s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media-wrap { position: relative; }
.card-img { height: 155px; width: 100%; object-fit: cover; background: var(--surface-alt); }
.fav-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.9); border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 1rem; cursor: pointer; }
.status-tag { position: absolute; top: 10px; left: 10px; background: var(--navy-900); color: #fff; font-size: 0.65rem; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; font-weight: 700; }
.status-tag.sold { background: var(--danger); }
.status-tag.paused { background: #9c8b1f; }
.status-tag.draft { background: #6b7280; }
.status-tag.removed { background: var(--danger); }

.card-body { padding: 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-cat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--teal-600); font-weight: 700; }
.card-title { font-size: 0.92rem; font-weight: 700; line-height: 1.3; }
.card-desc { font-size: 0.78rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.card-price { font-weight: 800; color: var(--navy-800); font-size: 1rem; }
[data-theme="dark"] .card-price { color: var(--teal-400); }
.card-meta { font-size: 0.72rem; color: var(--text-muted); }
.seller-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 0.75rem; }
.rating-row { font-size: 0.75rem; color: #b8860b; }

/* ===================== MODALS ===================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,22,38,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; animation: fadeIn 0.2s ease; overflow-y: auto; }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 30px; position: relative; box-shadow: var(--shadow-lg); animation: popIn 0.22s ease; margin: auto; }
.modal-large { max-width: 700px; }
.modal-close { position: absolute; top: 14px; right: 14px; background: var(--surface-alt); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: var(--text); z-index: 2; }
.modal-box h3 { margin-bottom: 18px; font-size: 1.25rem; }

/* ===================== FORMS ===================== */
.stacked-form label, #postProductForm label, #postServiceForm label { display: block; margin-bottom: 13px; font-size: 0.83rem; font-weight: 600; color: var(--text-muted); }
.stacked-form input, .stacked-form select, .stacked-form textarea,
#postProductForm input, #postProductForm select, #postProductForm textarea,
#postServiceForm input, #postServiceForm select, #postServiceForm textarea {
  width: 100%; margin-top: 6px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-alt); color: var(--text); font-size: 0.88rem; outline: none; transition: border var(--transition);
}
.stacked-form input:focus, #postProductForm input:focus, #postServiceForm input:focus,
#postProductForm select:focus, #postServiceForm select:focus,
#postProductForm textarea:focus, #postServiceForm textarea:focus { border-color: var(--teal-500); }
.form-row { display: flex; gap: 14px; }
.form-row label { flex: 1; }
.form-row.three label { flex: 1; }
.form-row-inline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 0.8rem; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text-muted); }
.checkbox-label input { width: auto; margin: 0; }
.form-error { color: var(--danger); font-size: 0.8rem; margin: 6px 0; }
.form-success { color: var(--success); font-size: 0.85rem; margin-top: 10px; text-align: center; }
.form-hint { font-size: 0.73rem; color: var(--text-muted); text-align: center; margin-top: 10px; line-height: 1.4; }
.form-btn-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.form-btn-row .btn { flex: 1; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px !important; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 0.95rem; }

.auth-tabs, .demo-btn-list { display: flex; gap: 8px; margin-bottom: 20px; }
.demo-btn-list { flex-direction: column; }
.auth-tab { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-alt); cursor: pointer; font-weight: 600; color: var(--text-muted); }
.auth-tab.active { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }
.image-preview { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 14px; }

/* ===================== SETTINGS / TOGGLES ===================== */
.settings-group { margin-bottom: 22px; }
.settings-group h4 { margin-bottom: 10px; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.setting-row:last-child { border-bottom: none; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: var(--transition); }
.slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: var(--transition); }
.switch input:checked + .slider { background: var(--teal-600); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ===================== SUPPORT CTA (Help page) ===================== */
.support-cta-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 26px;
}
.support-cta-icon { font-size: 2rem; flex-shrink: 0; }
.support-cta-body { flex: 1; min-width: 200px; }
.support-cta-body h3 { font-size: 1.05rem; margin-bottom: 4px; }
.support-cta-body p { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; }

/* ===================== DASHBOARD / ADMIN ===================== */
.dash-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-tab, .admin-tab { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-alt); cursor: pointer; font-size: 0.83rem; font-weight: 600; color: var(--text-muted); }
.dash-tab.active, .admin-tab.active { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }
.dash-panel { min-height: 100px; padding-bottom: 30px; }
.dash-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; background: var(--surface); }
.dash-item-info strong { font-size: 0.9rem; }
.dash-item-info div { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.dash-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 16px 0 22px; }
.admin-stat-card { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.admin-stat-card strong { display: block; font-size: 1.4rem; color: var(--teal-600); }
.admin-stat-card span { font-size: 0.72rem; color: var(--text-muted); }
.dash-panel { overflow-x: auto; }
.admin-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 0.83rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; }
.admin-table td.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-users-table { min-width: 1000px; }
.admin-users-table td:nth-child(3), .admin-users-table td:nth-child(4) { white-space: nowrap; }
.role-pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; text-transform: capitalize; background: rgba(20,184,166,0.12); color: var(--teal-600); }
.role-pill.role-super_admin { background: rgba(229,72,77,0.12); color: var(--danger); }
.role-pill.role-admin { background: rgba(20,184,166,0.18); color: var(--teal-600); }
.role-pill.role-employee { background: rgba(99,102,241,0.14); color: #6366f1; }
.mod-status-pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; text-transform: capitalize; background: rgba(20,184,166,0.12); color: var(--teal-600); }
.mod-status-pill.mod-warned { background: rgba(234,179,8,0.15); color: var(--warning); }
.mod-status-pill.mod-suspended { background: rgba(249,115,22,0.15); color: #c2410c; }
.mod-status-pill.mod-blocked { background: rgba(229,72,77,0.12); color: var(--danger); }
.employee-permissions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 14px; margin-bottom: 14px; max-height: 220px; overflow-y: auto; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.employee-permissions-grid label { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 400; }
.audit-log-reason { color: var(--text-muted); font-size: 0.76rem; }

/* Admin Overview cards */
.admin-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.admin-overview-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.admin-overview-card strong { display: block; font-size: 1.5rem; color: var(--teal-600); }
.admin-overview-card span { font-size: 0.78rem; color: var(--text-muted); }

/* ===================== PROFILE PAGE ===================== */
.profile-page { padding: 28px 0 50px; display: flex; flex-direction: column; gap: 22px; }

.profile-header {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 28px; display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap;
}
.profile-avatar-lg {
  width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal-500), var(--navy-700)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 800;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.profile-header-info { flex: 1; min-width: 220px; }
.profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name-row h1 { font-size: 1.5rem; font-weight: 800; }
.verify-badge { background: rgba(20,184,166,0.12); color: var(--teal-600); font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.profile-username { color: var(--text-muted); font-size: 0.92rem; margin-top: 2px; }
.profile-bio { margin-top: 10px; font-size: 0.88rem; line-height: 1.5; color: var(--text); max-width: 560px; }
.profile-meta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); align-items: center; }
.profile-status-pill { background: rgba(20,184,166,0.12); color: var(--teal-600); font-weight: 700; padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; }
.profile-status-pill.status-pill-danger { background: rgba(229,72,77,0.12); color: var(--danger); }
.profile-header-actions { flex-shrink: 0; }

.profile-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.profile-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.profile-stat-icon { font-size: 1.3rem; }
.profile-stat-card strong { font-size: 1.3rem; font-weight: 800; color: var(--navy-800); }
[data-theme="dark"] .profile-stat-card strong { color: var(--teal-400); }
.profile-stat-label { font-size: 0.72rem; color: var(--text-muted); }

.profile-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.profile-main .profile-card:last-child, .profile-sidebar .profile-card:last-child { margin-bottom: 0; }
.profile-card h3 { font-size: 1rem; margin-bottom: 16px; }

.profile-details { display: flex; flex-direction: column; }
.profile-detail-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.86rem; }
.profile-detail-row:last-child { border-bottom: none; }
.profile-detail-label { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.profile-detail-value { text-align: right; word-break: break-word; }

.profile-activity { display: flex; flex-direction: column; gap: 10px; }
.profile-activity-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.profile-activity-icon { font-size: 1.2rem; flex-shrink: 0; }
.profile-activity-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-activity-info strong { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-activity-info span { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }
.profile-empty { color: var(--text-muted); font-size: 0.85rem; padding: 6px 0; }

.profile-status-list { display: flex; flex-direction: column; gap: 16px; }
.profile-health-row { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; }
.profile-progress { background: var(--surface-alt); border-radius: 20px; height: 8px; overflow: hidden; }
.profile-progress-bar { height: 100%; background: linear-gradient(135deg, var(--teal-500), var(--teal-600)); border-radius: 20px; transition: width var(--transition); }
.profile-health-value { font-weight: 700; align-self: flex-end; }
.profile-health-row-simple { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; gap: 10px; }
.status-ok { color: var(--teal-600); font-weight: 600; white-space: nowrap; }
.status-warn { color: var(--warning); font-weight: 600; white-space: nowrap; }
.status-danger { color: var(--danger); font-weight: 600; white-space: nowrap; }

/* Edit Profile modal */
.profile-edit-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-avatar-md {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal-500), var(--navy-700)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.profile-edit-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .profile-header { flex-direction: column; align-items: center; text-align: center; padding: 22px; }
  .profile-header-info { text-align: center; }
  .profile-meta-row { justify-content: center; }
  .profile-header-actions { width: 100%; }
  .profile-header-actions .btn { width: 100%; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-detail-row { flex-direction: column; gap: 2px; }
  .profile-detail-value { text-align: left; }
}
@media (max-width: 400px) {
  .profile-avatar-lg { width: 80px; height: 80px; font-size: 1.8rem; }
}

/* ===================== MESSAGES ===================== */
.messages-layout { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: 65vh; background: var(--surface); margin-bottom: 30px; }
.chat-list { width: 220px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
.chat-list-item { padding: 13px 14px; cursor: pointer; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.chat-list-item.active { background: var(--surface-alt); font-weight: 700; }
.chat-list-item, .chat-thread-header { display: flex; align-items: center; gap: 10px; }
.chat-identity-text { min-width: 0; flex: 1; }
.chat-peer-name { display: block; overflow-wrap: anywhere; }
.chat-peer-avatar { width: 32px; height: 32px; flex-shrink: 0; }
.chat-thread-header small { display: block; color: var(--text-muted); font-weight: 400; margin-top: 3px; overflow-wrap: anywhere; }
.chat-list-item small { overflow-wrap: anywhere; }
.chat-list-item small { display: block; color: var(--text-muted); font-weight: 400; margin-top: 3px; }
.chat-thread { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.chat-thread-empty { margin: auto; color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 20px; }
.chat-thread-active { display: flex; flex-direction: column; height: 100%; }
.chat-thread-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.9rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 14px; font-size: 0.85rem; line-height: 1.4; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--teal-600); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: var(--surface-alt); border-bottom-left-radius: 4px; }
.msg-time { display: block; font-size: 0.63rem; opacity: 0.7; margin-top: 4px; }
.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); outline: none; min-width: 0; }

/* ===================== FAQ ===================== */
.faq-list { padding-bottom: 40px; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.faq-q { padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 0.88rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq-a { padding: 0 16px; max-height: 0; overflow: hidden; transition: all var(--transition); font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; }
.faq-item.open .faq-a { padding: 0 16px 16px; max-height: 300px; }

/* ===================== DETAIL MODAL CONTENT ===================== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-img { width: 100%; border-radius: 10px; height: 250px; object-fit: cover; background: var(--surface-alt); }
.detail-price { font-size: 1.7rem; font-weight: 800; color: var(--teal-600); margin: 10px 0; }
.detail-meta { color: var(--text-muted); font-size: 0.83rem; margin-bottom: 5px; }
.contact-locked { background: var(--surface-alt); padding: 10px 14px; border-radius: 8px; font-size: 0.83rem; color: var(--text-muted); margin: 10px 0; }
.locked-field { color: var(--danger); font-style: italic; }
.packages-wrap { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.package-card { flex: 1; min-width: 110px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; cursor: pointer; transition: all var(--transition); }
.package-card.selected { border-color: var(--teal-500); background: rgba(20,184,166,0.08); }
.package-card strong { display: block; font-size: 1.2rem; color: var(--teal-600); margin: 5px 0; }
.package-card span.pkg-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; }
.review-item { border-top: 1px solid var(--border); padding: 10px 0; font-size: 0.82rem; }
.review-item strong { display: block; margin-bottom: 3px; }
.skills-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.skill-pill { background: var(--surface-alt); padding: 3px 10px; border-radius: 12px; font-size: 0.7rem; color: var(--text-muted); }

/* ===================== TOAST ===================== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy-900); color: #fff; padding: 12px 24px; border-radius: 30px; font-size: 0.83rem; z-index: 2000; box-shadow: var(--shadow-lg); animation: fadeSlideUp 0.25s ease; max-width: 90vw; text-align: center; }

/* ===================== FOOTER ===================== */
.marketh-footer {
  background: var(--navy-950);
  color: rgba(238,243,248,0.72);
  margin-top: 40px;
  font-size: 0.86rem;
}
.marketh-footer-content {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
  padding: 52px 20px 40px;
}
.marketh-footer-brand .marketh-footer-logo {
  font-size: 1.4rem; font-weight: 800; color: #fff; text-decoration: none;
  display: flex; flex-direction: column; line-height: 1; margin-bottom: 14px;
}
.marketh-footer-brand .marketh-footer-logo .tagline {
  font-size: 0.55rem; letter-spacing: 1.5px; color: var(--teal-400); font-weight: 700; margin-top: 4px;
}
.marketh-footer-desc {
  line-height: 1.55; margin-bottom: 10px; max-width: 260px; color: rgba(238,243,248,0.68);
}
.marketh-footer-demo-note {
  font-size: 0.74rem; color: rgba(238,243,248,0.5); margin-bottom: 18px;
}
.marketh-footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.marketh-social-icon {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center; color: #fff;
  transition: background var(--transition), transform var(--transition), color var(--transition);
  text-decoration: none; flex-shrink: 0;
}
.marketh-social-icon:hover { background: var(--teal-500); transform: translateY(-2px); color: #fff; }

.marketh-footer-section h4 {
  color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 16px; font-weight: 700;
}
.marketh-footer-section ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.marketh-footer-section a {
  color: rgba(238,243,248,0.68); text-decoration: none; font-size: 0.85rem;
  transition: color var(--transition), padding-left var(--transition); cursor: pointer;
}
.marketh-footer-section a:hover { color: var(--teal-400); padding-left: 3px; }
.footer-toggle { display: none; }

/* Only the mobile footer changes; desktop headings and columns stay intact. */
@media (max-width: 768px) {
  #marketh-footer {
    --footer-row-bg: var(--navy-950);
    --footer-row-text: #eef3f8;
    --footer-link-text: rgba(238,243,248,0.78);
    --footer-row-border: rgba(238,243,248,0.12);
    --footer-row-hover: var(--navy-900);
  }
  [data-theme="dark"] #marketh-footer {
    --footer-row-bg: var(--surface);
    --footer-row-text: var(--text);
    --footer-link-text: var(--text-muted);
    --footer-row-border: var(--border);
    --footer-row-hover: var(--surface-alt);
  }
  #marketh-footer .marketh-footer-content { display: block; padding: 0; }
  #marketh-footer .marketh-footer-brand { padding: 20px 14px 18px; }
  #marketh-footer .marketh-footer-logo { font-size: 1.3rem; margin-bottom: 10px; }
  #marketh-footer .marketh-footer-desc { font-size: 0.8rem; margin-bottom: 0; max-width: none; }
  #marketh-footer .marketh-footer-section { background: var(--footer-row-bg); color: var(--footer-row-text); border-bottom: 1px solid var(--footer-row-border); }
  #marketh-footer .marketh-footer-section h4 { margin: 0; }
  #marketh-footer .footer-heading-text { display: none; }
  #marketh-footer .footer-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; min-height: 50px; padding: 14px 18px; border: 0;
    background: var(--footer-row-bg); color: var(--footer-row-text); font: inherit; font-size: 0.9rem;
    font-weight: 600; text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer;
  }
  #marketh-footer .footer-toggle:hover { background: var(--footer-row-hover); }
  #marketh-footer .footer-toggle:focus-visible { outline: 3px solid var(--teal-400); outline-offset: -4px; }
  #marketh-footer .footer-chevron { flex-shrink: 0; transition: transform 160ms ease; }
  #marketh-footer .footer-toggle[aria-expanded="true"] .footer-chevron { transform: rotate(90deg); }
  #marketh-footer .footer-links-panel { display: none; padding: 0 18px 16px; gap: 0; }
  #marketh-footer .is-open .footer-links-panel { display: flex; }
  #marketh-footer .footer-links-panel a { display: block; padding: 9px 0; color: var(--footer-link-text); overflow-wrap: anywhere; }
  #marketh-footer .footer-links-panel a:hover { color: var(--teal-400); padding-left: 3px; }
  #marketh-footer .footer-links-panel a:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 2px; }
  #marketh-footer .marketh-footer-bottom-inner { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 16px 14px; }
  #marketh-footer .marketh-social-icon { width: 32px; height: 32px; }
  #marketh-footer .marketh-footer-bottom-inner > p { font-size: 0.69rem; line-height: 1.5; max-width: 100%; padding-inline: 44px; }
  #marketh-footer .marketh-footer-bottom-note:empty { display: none; }
}
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  #marketh-footer .footer-chevron { transition: none; }
}

.marketh-footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); }
.marketh-footer-bottom-inner {
  padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 0.76rem; color: rgba(238,243,248,0.55);
}
.marketh-footer-bottom-note { color: rgba(238,243,248,0.4); }

.marketh-back-to-top {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer; z-index: 900; font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-600)); color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition);
}
.marketh-back-to-top.marketh-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.marketh-back-to-top:hover { transform: translateY(-3px); }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .marketh-footer-content { grid-template-columns: repeat(4, 1fr); }
  .marketh-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .messages-layout { flex-direction: column; height: auto; }
  .chat-list { width: 100%; max-height: 160px; border-right: none; border-bottom: 1px solid var(--border); }
  .chat-thread { min-height: 400px; }
  .marketh-footer-content { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
}
@media (max-width: 768px) {
  .header-inner { gap: 8px; }
  .form-row, .form-row.three { flex-direction: column; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
  .modal-box { padding: 22px; }
  .header-actions { gap: 4px; }
  .admin-table { font-size: 0.78rem; }
  .admin-table th, .admin-table td { padding: 8px 6px; }
}
@media (max-width: 640px) {
  .marketh-footer-content { grid-template-columns: 1fr 1fr; padding: 40px 20px 30px; gap: 26px 20px; }
  .marketh-footer-bottom-inner { flex-direction: column; align-items: flex-start; text-align: left; }
  .marketh-back-to-top { right: 14px; bottom: 14px; }
  .admin-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .support-cta-card { flex-direction: column; align-items: flex-start; }
  .support-cta-card .btn { width: 100%; }
}
@media (max-width: 480px) {
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-inner h1 { font-size: 1.45rem; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .marketh-footer-content { grid-template-columns: 1fr; }
  .marketh-footer-desc { max-width: none; }
  .modal-box { padding: 18px; }
  .modal-overlay { padding: 12px; }
  .container { padding: 0 14px; }
  .view-title { font-size: 1.3rem; padding: 20px 0 12px; }
  .package-card { min-width: 92px; }
  .form-row.three { flex-direction: column; }
  .hero { padding: 40px 0 32px; }
  .search-bar { flex-direction: column; border-radius: 16px; }
  .search-bar input { border-radius: 16px 16px 0 0; }
  .search-bar .btn { border-radius: 0 0 16px 16px; }
}
@media (max-width: 360px) {
  .grid-cards { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stats, .admin-overview-grid { grid-template-columns: 1fr; }
  .hero-inner h1 { font-size: 1.25rem; }
}

/* =====================================================================
   ADMIN SUPPORT PANEL — visual polish
   ---------------------------------------------------------------------
   Every rule below is scoped to #adminSupportPanel, so the user-facing
   "My tickets" list, the other admin tabs and the rest of the site are
   not affected. !important is used only where the JS renders inline
   styles that would otherwise win.
   ===================================================================== */

#adminSupportPanel {
  --sp-blue-bg: rgba(59,130,246,0.12);   --sp-blue-fg: #1d4ed8;   --sp-blue-bd: rgba(59,130,246,0.30);
  --sp-amber-bg: rgba(245,158,11,0.15);  --sp-amber-fg: #b45309;  --sp-amber-bd: rgba(245,158,11,0.35);
  --sp-green-bg: rgba(20,184,166,0.14);  --sp-green-fg: #0d9488;  --sp-green-bd: rgba(20,184,166,0.35);
  --sp-gray-bg: rgba(107,114,128,0.14);  --sp-gray-fg: #4b5563;   --sp-gray-bd: rgba(107,114,128,0.30);
  --sp-orange-bg: rgba(249,115,22,0.14); --sp-orange-fg: #c2410c; --sp-orange-bd: rgba(249,115,22,0.35);
  --sp-red-bg: rgba(229,72,77,0.13);     --sp-red-fg: #dc2626;    --sp-red-bd: rgba(229,72,77,0.35);
  padding: 4px 4px 30px;
}
[data-theme="dark"] #adminSupportPanel {
  --sp-blue-fg: #93c5fd;
  --sp-amber-fg: #fbbf24;
  --sp-green-fg: #2dd4bf;
  --sp-gray-fg: #b6c2d3;
  --sp-orange-fg: #fdba74;
  --sp-red-fg: #fca5a5;
}

/* ---------- Toolbar: "Support Tickets (N)" + Refresh ---------- */
#adminSupportPanel > div:first-child {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 18px !important;
}
#adminSupportPanel > div:first-child > strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1px;
  color: var(--text);
}
#adminSupportPanel [data-support-refresh] {
  font-weight: 600;
}
#adminSupportPanel [data-support-refresh]:hover:not(:disabled) {
  background: rgba(20,184,166,0.1);
  transform: translateY(-1px);
}
#adminSupportPanel [data-support-refresh]:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}
#adminSupportPanel [data-support-refresh]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
#adminSupportPanel [data-support-refresh]:focus-visible,
#adminSupportPanel [data-support-save]:focus-visible {
  outline: 2px solid var(--teal-400);
  outline-offset: 2px;
}

/* ---------- Ticket card ---------- */
#adminSupportPanel .ticket-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px 16px 24px;
  margin-bottom: 18px !important;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#adminSupportPanel .ticket-card:hover {
  border-color: rgba(20,184,166,0.55);
  box-shadow: var(--shadow-lg);
}
/* Left accent bar — colour follows ticket status */
#adminSupportPanel .ticket-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--teal-500);
}
#adminSupportPanel .ticket-card:has(.ticket-status-open)::before     { background: #3b82f6; }
#adminSupportPanel .ticket-card:has(.ticket-status-progress)::before { background: #f59e0b; }
#adminSupportPanel .ticket-card:has(.ticket-status-resolved)::before { background: var(--teal-500); }
#adminSupportPanel .ticket-card:has(.ticket-status-closed)::before   { background: #9ca3af; }

/* ---------- Ticket header ---------- */
#adminSupportPanel .ticket-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
#adminSupportPanel .ticket-subject {
  flex: 1 1 260px;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}
#adminSupportPanel .ticket-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Status & priority badges ---------- */
#adminSupportPanel .ticket-status,
#adminSupportPanel .ticket-priority {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
}
#adminSupportPanel .ticket-status::before,
#adminSupportPanel .ticket-priority::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
/* Status */
#adminSupportPanel .ticket-status-open     { background: var(--sp-blue-bg);  color: var(--sp-blue-fg);  border-color: var(--sp-blue-bd); }
#adminSupportPanel .ticket-status-progress { background: var(--sp-amber-bg); color: var(--sp-amber-fg); border-color: var(--sp-amber-bd); }
#adminSupportPanel .ticket-status-resolved { background: var(--sp-green-bg); color: var(--sp-green-fg); border-color: var(--sp-green-bd); }
#adminSupportPanel .ticket-status-closed   { background: var(--sp-gray-bg);  color: var(--sp-gray-fg);  border-color: var(--sp-gray-bd); }
/* Priority (square-ish dot + softer look so it reads differently from status) */
#adminSupportPanel .ticket-priority::before { border-radius: 2px; }
#adminSupportPanel .ticket-priority-low    { background: var(--sp-gray-bg);   color: var(--sp-gray-fg);   border-color: var(--sp-gray-bd); }
#adminSupportPanel .ticket-priority-normal { background: var(--sp-blue-bg);   color: var(--sp-blue-fg);   border-color: var(--sp-blue-bd); }
#adminSupportPanel .ticket-priority-high   { background: var(--sp-orange-bg); color: var(--sp-orange-fg); border-color: var(--sp-orange-bd); }
#adminSupportPanel .ticket-priority-urgent { background: var(--sp-red-bg);    color: var(--sp-red-fg);    border-color: var(--sp-red-bd); font-weight: 800; }

/* ---------- User information line ---------- */
#adminSupportPanel .ticket-card-head + div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 12px 0 14px !important;
  font-size: 0.84rem !important;
  line-height: 1.45;
  color: var(--text-muted) !important;
  word-break: break-word;
}
#adminSupportPanel .ticket-card-head + div small {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  word-break: break-all;
}

/* ---------- User message ---------- */
#adminSupportPanel .ticket-message {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
#adminSupportPanel .ticket-message::before {
  content: "User message";
  display: block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Current admin reply (visually distinct from user message) ---------- */
#adminSupportPanel .ticket-admin-reply {
  background: rgba(20,184,166,0.08);
  border: 1px solid rgba(20,184,166,0.30);
  border-left: 3px solid var(--teal-500);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
#adminSupportPanel .ticket-admin-reply strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--teal-600);
}
[data-theme="dark"] #adminSupportPanel .ticket-admin-reply strong { color: var(--teal-400); }
#adminSupportPanel .ticket-admin-reply p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Status / Priority controls row ---------- */
#adminSupportPanel .ticket-card > div:has(.support-status-select) {
  gap: 12px 14px !important;
  margin: 16px 0 14px !important;
}
#adminSupportPanel .ticket-card > div:has(.support-status-select) > label {
  flex: 1 1 160px;
  max-width: 240px;
}

/* Field labels ("Status", "Priority", "Admin reply") */
#adminSupportPanel .ticket-card label {
  display: flex !important;
  flex-direction: column;
  gap: 6px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Shared control look */
#adminSupportPanel .support-status-select,
#adminSupportPanel .support-priority-select,
#adminSupportPanel .support-reply-input {
  width: 100%;
  background-color: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 400 !important;
  letter-spacing: normal;
  text-transform: none;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
#adminSupportPanel .support-status-select:hover:not(:disabled),
#adminSupportPanel .support-priority-select:hover:not(:disabled),
#adminSupportPanel .support-reply-input:hover:not(:disabled) {
  border-color: rgba(20,184,166,0.6);
}
#adminSupportPanel .support-status-select:focus,
#adminSupportPanel .support-priority-select:focus,
#adminSupportPanel .support-reply-input:focus {
  border-color: var(--teal-500);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.18);
}
#adminSupportPanel .support-status-select:disabled,
#adminSupportPanel .support-priority-select:disabled,
#adminSupportPanel .support-reply-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Selects */
#adminSupportPanel .support-status-select,
#adminSupportPanel .support-priority-select {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  padding: 0 36px 0 12px;
  font-weight: 600 !important;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6b81' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}
#adminSupportPanel .support-status-select:disabled,
#adminSupportPanel .support-priority-select:disabled { cursor: not-allowed; }

/* Admin reply textarea */
#adminSupportPanel .support-reply-input {
  display: block;
  min-height: 96px;
  padding: 11px 13px;
  line-height: 1.55;
  resize: vertical;
}
#adminSupportPanel .support-reply-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
  font-style: italic;
}

/* Inline error under the reply */
#adminSupportPanel .support-card-error:not(.hidden) {
  background: rgba(229,72,77,0.1);
  border: 1px solid rgba(229,72,77,0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 0 0 !important;
}

/* ---------- Save / Update row ---------- */
#adminSupportPanel .ticket-card > div:has([data-support-save]) {
  margin-top: 14px !important;
}
#adminSupportPanel [data-support-save] {
  padding: 9px 22px;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
}
#adminSupportPanel [data-support-save]:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(20,184,166,0.35);
}

/* ---------- Created / Updated ---------- */
#adminSupportPanel .ticket-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  opacity: 0.9;
}

/* ---------- Support panel — responsive ---------- */
@media (max-width: 768px) {
  #adminSupportPanel .ticket-card { padding: 16px 16px 14px 18px; }
}
@media (max-width: 640px) {
  #adminSupportPanel > div:first-child { padding: 10px 12px; }
  #adminSupportPanel .ticket-card { padding: 14px 14px 12px 16px; border-radius: var(--radius); }
  #adminSupportPanel .ticket-card-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  #adminSupportPanel .ticket-subject { flex: 0 0 auto; width: 100%; font-size: 0.98rem; }
  #adminSupportPanel .ticket-card > div:has(.support-status-select) > label {
    flex: 1 1 100%;
    max-width: none;
  }
  #adminSupportPanel .ticket-card > div:has([data-support-save]) { justify-content: stretch !important; }
  #adminSupportPanel [data-support-save] { width: 100%; padding: 11px 18px; font-size: 0.88rem; }
  #adminSupportPanel .ticket-card-foot { flex-direction: column; gap: 3px; }
  #adminSupportPanel .support-status-select,
  #adminSupportPanel .support-priority-select { height: 44px; font-size: 0.92rem; }
  #adminSupportPanel .support-reply-input { font-size: 0.92rem; }
}
@media (max-width: 400px) {
  #adminSupportPanel { padding-left: 0; padding-right: 0; }
  #adminSupportPanel .ticket-card { padding: 12px 12px 10px 14px; }
  #adminSupportPanel .ticket-status,
  #adminSupportPanel .ticket-priority { padding: 3px 9px; font-size: 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  #adminSupportPanel .ticket-card,
  #adminSupportPanel .support-status-select,
  #adminSupportPanel .support-priority-select,
  #adminSupportPanel .support-reply-input,
  #adminSupportPanel [data-support-refresh],
  #adminSupportPanel [data-support-save] { transition: none; }
}

/* Premium Search Bar Container */
.premium-search-wrapper {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border-radius: 50px;
  padding: 6px 6px 6px 20px;
  max-width: 650px;
  width: 100%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #f1f5f9;
}

/* Jab user click kare toh Focus Glow */
.premium-search-wrapper:focus-within {
  box-shadow: 0 8px 30px rgba(32, 178, 170, 0.25);
  transform: translateY(-2px);
  border-color: #20b2aa;
}

/* Magnifying Glass Icon */
.premium-search-wrapper .search-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
  margin-right: 10px;
}

/* Input Field */
.premium-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.05rem;
  color: #334155;
  padding: 10px 0;
  width: 100%;
}

.premium-search-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Premium Search Button */
.premium-search-btn {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #ffffff;
  border: none;
  border-radius: 40px;
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
  transition: all 0.3s ease;
  margin-left: 5px;
}

/* Button Hover Effect */
.premium-search-btn:hover {
  background: linear-gradient(135deg, #0f766e, #0f766e);
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

/* ====== MOBILE RESPONSIVE FIX FOR SEARCH BAR ====== */
/* ====== MOBILE POST BUTTON FIX ====== */
/* ====== MOBILE RESPONSIVE FIX (ALL IN ONE) ====== */
@media (max-width: 850px) {
  /* 1. Upar wale (header) search bar ko hide karein taake Post button ki jagah banay */
  #headerSearchForm.premium-search-wrapper {
    display: none !important;
  }
  
  /* 2. Post button (+) ko mobile par lazmi show karein */
  header [data-post] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 14px !important;
    font-size: 0.9rem !important;
    border-radius: 50px !important;
    margin-left: 5px !important;
  }
  
  /* 3. Beech wale (main) search bar ko chota aur perfect karein */
  .premium-search-wrapper {
    padding: 4px 4px 4px 14px !important;
    max-width: 90% !important;
  }
  .premium-search-btn {
    padding: 8px 18px !important;
    font-size: 0.9rem !important;
  }
  .premium-search-input {
    font-size: 0.9rem !important;
  }
  .premium-search-wrapper .search-icon svg {
    width: 18px;
    height: 18px;
  }
}
/* Referral promotions are isolated from the organic listing grid. */
.featured-referrals{margin:20px 0;padding:18px;border:1px solid #8abfb3;border-radius:16px;background:var(--card-bg,#f0f8f5)}
.featured-referral-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.featured-referral-card{display:flex;gap:15px;align-items:center;text-decoration:none;color:inherit;min-width:0}
.featured-referral-card img{width:120px;height:100px;object-fit:cover;border-radius:12px;flex-shrink:0}
.featured-referral-card h3{overflow-wrap:anywhere;margin:6px 0}.featured-referral-card small{color:#087f74}
@media(max-width:650px){.featured-referral-grid{grid-template-columns:1fr}.featured-referral-card:nth-child(n+2){display:none}}
