/* ============================================================
   CellMart — Design System v2
   Estética: Marketplace moderno, limpo, confiável
   Tipografia: Syne (display) + DM Sans (corpo)
   Cores: Laranja vibrante + cinza escuro + branco limpo
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── CSS Variables ────────────────────────────────────────── */
:root {
  --brand:       #FF6B00;
  --brand-light: #FF8C35;
  --brand-dark:  #E05500;
  --brand-bg:    #FFF4ED;
  --dark:        #0F1117;
  --dark-2:      #1C1F2E;
  --dark-3:      #2A2D3E;
  --mid:         #6B7280;
  --light:       #E5E7EB;
  --lighter:     #F3F4F6;
  --lightest:    #F9FAFB;
  --white:       #FFFFFF;
  --success:     #10B981;
  --warning:     #F59E0B;
  --danger:      #EF4444;
  --info:        #3B82F6;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow:    0 4px 16px rgba(0,0,0,.08);
  --shadow-md: 0 8px 32px rgba(0,0,0,.12);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.16);
  --shadow-brand: 0 8px 24px rgba(255,107,0,.25);

  --header-h: 64px;
  --sidebar-w: 260px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--lightest);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── Typography ───────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }

/* ─── Header ───────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--light);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 16px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800;
  color: var(--brand);
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.logo span { color: var(--dark); }

/* Search bar */
.search-bar {
  flex: 1; max-width: 560px; position: relative;
}
.search-bar input {
  width: 100%; height: 42px;
  padding: 0 48px 0 16px;
  border: 2px solid var(--light);
  border-radius: var(--radius-xl);
  font-size: .9rem; font-family: var(--font-body);
  background: var(--lighter);
  transition: var(--transition);
  outline: none;
}
.search-bar input:focus { border-color: var(--brand); background: var(--white); box-shadow: 0 0 0 4px rgba(255,107,0,.1); }
.search-bar button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); border: none; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.search-bar button:hover { background: var(--brand-dark); }

/* Autocomplete */
.autocomplete-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white); border: 1px solid var(--light);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 100; overflow: hidden;
  animation: fadeDown .15s ease;
}
.autocomplete-list li {
  padding: 10px 16px; cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--transition);
}
.autocomplete-list li:hover { background: var(--lighter); }
@keyframes fadeDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

/* Header nav */
.header-nav { display: flex; align-items: center; gap: 8px; }
.header-nav a, .header-nav button {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 10px; border-radius: var(--radius);
  border: none; background: none; color: var(--mid);
  font-size: .7rem; font-family: var(--font-body);
  transition: var(--transition); white-space: nowrap;
}
.header-nav a svg, .header-nav button svg { width: 20px; height: 20px; }
.header-nav a:hover, .header-nav button:hover { color: var(--brand); background: var(--brand-bg); }
.header-nav .active { color: var(--brand); }
.btn-post-ad {
  background: var(--brand) !important; color: var(--white) !important;
  padding: 8px 16px !important; border-radius: var(--radius) !important;
  font-weight: 600; font-size: .85rem !important; flex-direction: row !important;
  box-shadow: var(--shadow-brand);
}
.btn-post-ad:hover { background: var(--brand-dark) !important; }

/* Notification badge */
.notif-badge {
  position: relative; display: inline-flex;
}
.notif-badge .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: var(--white);
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
}

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 8px; border: none; background: none; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--dark); border-radius: 2px; transition: var(--transition); }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile nav overlay */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: var(--white); padding-top: var(--header-h);
  flex-direction: column; overflow-y: auto;
}
.mobile-nav.open { display: flex; animation: slideIn .25s ease; }
@keyframes slideIn { from { opacity:0; transform:translateX(-20px); } to { opacity:1; transform:none; } }
.mobile-nav a {
  padding: 14px 24px; font-size: 1rem; font-weight: 500;
  border-bottom: 1px solid var(--lighter); color: var(--dark);
  display: flex; align-items: center; gap: 12px;
}
.mobile-nav a:hover { background: var(--lighter); color: var(--brand); }

/* ─── Layout ────────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.page-wrap { padding: 24px 0 48px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius); border: none;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  text-decoration: none; line-height: 1;
}
.btn-primary   { background: var(--brand); color: var(--white); box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--lighter); color: var(--dark); }
.btn-secondary:hover { background: var(--light); }
.btn-outline   { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand-bg); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { filter: brightness(.9); }
.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover { filter: brightness(.9); }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--light);
  overflow: hidden; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--lighter); }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--lighter); background: var(--lightest); }

/* ─── Product Card ──────────────────────────────────────────── */
.product-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--light); overflow: hidden;
  cursor: pointer; transition: var(--transition);
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.product-card.featured { border-color: var(--brand); }
.product-card.featured::before {
  content: '⭐ Destaque'; position: absolute; top: 10px; left: 10px;
  background: var(--brand); color: var(--white);
  font-size: .68rem; font-weight: 700; padding: 3px 8px;
  border-radius: 20px; z-index: 2;
}
.product-card-img {
  position: relative; padding-top: 70%; overflow: hidden; background: var(--lighter);
}
.product-card-img img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-img .no-img {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; color: var(--light);
}
.fav-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: rgba(255,255,255,.9); border: none; border-radius: 50%;
  width: 32px; height: 32px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: var(--transition);
  backdrop-filter: blur(4px);
}
.fav-btn:hover { background: var(--white); transform: scale(1.1); }
.fav-btn.active { color: var(--danger); }
.fav-btn svg { width: 16px; height: 16px; }
.product-card-body { padding: 12px 14px 14px; }
.product-card-title {
  font-size: .88rem; font-weight: 600; color: var(--dark);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 6px; line-height: 1.35;
}
.product-card-price {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: var(--brand); margin-bottom: 6px;
}
.product-card-price small { font-family: var(--font-body); font-size: .75rem; color: var(--mid); font-weight: 400; }
.product-card-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; color: var(--mid);
}
.condition-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: .7rem; font-weight: 600;
}
.condition-novo     { background: #D1FAE5; color: #065F46; }
.condition-seminovo { background: #DBEAFE; color: #1E3A8A; }
.condition-usado    { background: #F3F4F6; color: #374151; }
.condition-pecas    { background: #FEF3C7; color: #92400E; }

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--dark-2) 0%, var(--dark) 50%, #1a0800 100%);
  padding: 56px 0; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255,107,0,.18) 0%, transparent 65%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 600px; }
.hero h1 { color: var(--white); margin-bottom: 12px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { color: rgba(255,255,255,.7); margin-bottom: 28px; font-size: 1.05rem; }
.hero-search {
  display: flex; gap: 0; background: var(--white); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-lg); max-width: 520px;
}
.hero-search input {
  flex: 1; border: none; outline: none; padding: 14px 20px;
  font-size: 1rem; font-family: var(--font-body);
}
.hero-search button {
  background: var(--brand); color: var(--white); border: none;
  padding: 14px 24px; font-size: .9rem; font-weight: 600;
  font-family: var(--font-body); cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.hero-search button:hover { background: var(--brand-dark); }
.hero-stats {
  display: flex; gap: 32px; margin-top: 28px;
}
.hero-stat { color: rgba(255,255,255,.8); font-size: .85rem; }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--white); font-weight: 700; }

/* ─── Categories ────────────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}
.cat-card {
  background: var(--white); border: 1px solid var(--light);
  border-radius: var(--radius); padding: 16px 10px;
  text-align: center; cursor: pointer; transition: var(--transition);
  text-decoration: none; color: var(--dark);
}
.cat-card:hover { border-color: var(--brand); background: var(--brand-bg); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card .cat-icon { font-size: 1.8rem; margin-bottom: 6px; }
.cat-card .cat-name { font-size: .75rem; font-weight: 600; color: var(--mid); }
.cat-card .cat-count { font-size: .65rem; color: var(--light); margin-top: 2px; }

/* ─── Filters sidebar ────────────────────────────────────────── */
.filter-panel { background: var(--white); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--light); }
.filter-section { margin-bottom: 24px; }
.filter-section h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mid); margin-bottom: 12px; font-weight: 600; }
.filter-option {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; cursor: pointer; font-size: .875rem;
}
.filter-option input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; }
.price-range { display: flex; gap: 8px; align-items: center; }
.price-range input {
  flex: 1; padding: 8px 10px; border: 1.5px solid var(--light);
  border-radius: var(--radius-sm); font-size: .875rem; outline: none;
  transition: var(--transition);
}
.price-range input:focus { border-color: var(--brand); }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--dark-2); }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--light); border-radius: var(--radius);
  font-size: .9rem; font-family: var(--font-body);
  background: var(--white); outline: none; transition: var(--transition);
  color: var(--dark);
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255,107,0,.08); }
.form-control.error { border-color: var(--danger); }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }

/* ─── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .2s ease; backdrop-filter: blur(4px);
}
.modal {
  background: var(--white); border-radius: var(--radius-xl);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  animation: popIn .25s cubic-bezier(.34,1.56,.64,1);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--lighter);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  background: none; border: none; font-size: 1.3rem; color: var(--mid);
  cursor: pointer; padding: 4px; border-radius: 6px;
  transition: var(--transition); line-height: 1;
}
.modal-close:hover { background: var(--lighter); color: var(--dark); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 12px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes popIn  { from { opacity:0; transform:scale(.92); } to { opacity:1; transform:none; } }

/* ─── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.toast {
  background: var(--dark-2); color: var(--white);
  padding: 14px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: .875rem;
  display: flex; align-items: flex-start; gap: 10px;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
  border-left: 4px solid var(--brand);
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.info    { border-color: var(--info); }
.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-close { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.6); cursor: pointer; font-size: 1.1rem; padding: 0 0 0 8px; }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ─── Stars Rating ───────────────────────────────────────────── */
.stars { display: inline-flex; gap: 2px; color: var(--warning); font-size: .9rem; }
.stars-input { display: flex; gap: 4px; }
.stars-input label { font-size: 1.4rem; cursor: pointer; color: var(--light); transition: color .15s; }
.stars-input input:checked ~ label,
.stars-input label:hover,
.stars-input label:hover ~ label { color: var(--warning); }
.stars-input { flex-direction: row-reverse; }

/* ─── Chat UI ────────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - var(--header-h) - 48px); }
.chat-sidebar { border-right: 1px solid var(--light); overflow-y: auto; background: var(--white); }
.chat-item {
  padding: 14px 16px; border-bottom: 1px solid var(--lighter); cursor: pointer;
  transition: background var(--transition); display: flex; gap: 12px; align-items: flex-start;
}
.chat-item:hover { background: var(--lighter); }
.chat-item.active { background: var(--brand-bg); border-left: 3px solid var(--brand); }
.chat-item-img { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; background: var(--light); }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-preview { font-size: .8rem; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item-time { font-size: .72rem; color: var(--mid); white-space: nowrap; }
.chat-item-unread { background: var(--brand); color: var(--white); font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

.chat-main { display: flex; flex-direction: column; background: var(--lightest); }
.chat-header { padding: 14px 20px; background: var(--white); border-bottom: 1px solid var(--light); display: flex; align-items: center; gap: 12px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; max-width: 75%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--light); }
.msg-bubble {
  background: var(--white); padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  font-size: .875rem; line-height: 1.5; border: 1px solid var(--light);
  box-shadow: var(--shadow-sm);
}
.msg.mine .msg-bubble { background: var(--brand); color: var(--white); border: none; border-radius: 16px 16px 4px 16px; }
.msg-time { font-size: .68rem; color: var(--mid); margin-top: 4px; text-align: right; }
.chat-input-area { padding: 14px 20px; background: var(--white); border-top: 1px solid var(--light); display: flex; gap: 10px; }
.chat-input { flex: 1; border: 1.5px solid var(--light); border-radius: var(--radius-xl); padding: 10px 16px; font-size: .9rem; outline: none; resize: none; max-height: 100px; font-family: var(--font-body); transition: var(--transition); }
.chat-input:focus { border-color: var(--brand); }

/* ─── Admin Panel ────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: calc(100vh - var(--header-h)); }
.admin-sidebar {
  width: var(--sidebar-w); background: var(--dark-2); flex-shrink: 0;
  padding: 24px 0; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: rgba(255,255,255,.65); font-size: .875rem;
  font-weight: 500; cursor: pointer; transition: var(--transition);
  border-left: 3px solid transparent; text-decoration: none;
}
.admin-nav-item:hover  { color: var(--white); background: rgba(255,255,255,.06); }
.admin-nav-item.active { color: var(--brand); border-color: var(--brand); background: rgba(255,107,0,.1); }
.admin-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-content { flex: 1; padding: 28px; max-width: 100%; overflow-x: hidden; }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 20px;
  border: 1px solid var(--light); display: flex; flex-direction: column; gap: 8px;
}
.stat-card-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; }
.stat-card-label { font-size: .8rem; color: var(--mid); font-weight: 500; }
.stat-card-icon { font-size: 1.8rem; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th { background: var(--lighter); padding: 10px 14px; text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mid); border-bottom: 2px solid var(--light); white-space: nowrap; }
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--lighter); vertical-align: middle; }
tbody tr:hover { background: var(--lightest); }
tbody tr:last-child td { border-bottom: none; }

/* ─── Image Upload ────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--light); border-radius: var(--radius-lg);
  padding: 32px; text-align: center; cursor: pointer; transition: var(--transition);
  background: var(--lightest);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--brand); background: var(--brand-bg); }
.upload-zone .icon { font-size: 2.5rem; margin-bottom: 8px; }
.upload-zone p { font-size: .9rem; color: var(--mid); }
.upload-zone strong { color: var(--brand); }
.image-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.image-preview {
  position: relative; width: 80px; height: 80px; border-radius: var(--radius);
  overflow: hidden; border: 2px solid var(--light);
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .remove-img {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6);
  color: white; border: none; border-radius: 50%; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: .75rem;
}
.image-preview.primary::after {
  content: '★'; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: white; font-size: .65rem; padding: 1px 5px; border-radius: 8px;
}

/* ─── Carousel ───────────────────────────────────────────────── */
.carousel { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--lighter); }
.carousel-track { display: flex; transition: transform .35s cubic-bezier(.4,0,.2,1); }
.carousel-slide { flex-shrink: 0; width: 100%; }
.carousel-slide img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.9); border: none; border-radius: 50%;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow); transition: var(--transition); z-index: 10;
}
.carousel-btn:hover { background: var(--white); box-shadow: var(--shadow-md); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.6); border: none; cursor: pointer; transition: var(--transition); }
.carousel-dot.active { background: var(--white); transform: scale(1.2); }
.carousel-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: white; font-size: .75rem; padding: 4px 8px; border-radius: 20px; }

/* ─── Profile ────────────────────────────────────────────────── */
.profile-header { background: linear-gradient(135deg, var(--dark-2), var(--dark)); padding: 32px 0; color: white; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand); background: var(--dark-3); }
.verified-badge { background: var(--success); color: white; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; display: inline-flex; align-items: center; gap: 3px; }
.premium-badge  { background: var(--warning); color: white; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; display: inline-flex; align-items: center; gap: 3px; }
.reputation-bar { height: 6px; background: var(--light); border-radius: 3px; overflow: hidden; }
.reputation-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--warning)); border-radius: 3px; transition: width .6s ease; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 32px; }
.page-btn {
  min-width: 36px; height: 36px; border-radius: var(--radius);
  border: 1.5px solid var(--light); background: var(--white); color: var(--dark);
  font-size: .875rem; font-weight: 500; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover  { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: white; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Loading ────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--lighter) 25%, var(--light) 50%, var(--lighter) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 32px; height: 32px; border: 3px solid var(--lighter); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.8); z-index: 9998; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; opacity: .5; }
.empty-state h3 { margin-bottom: 8px; color: var(--mid); }
.empty-state p { color: var(--mid); font-size: .9rem; }

/* ─── Section Titles ─────────────────────────────────────────── */
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title h2 { font-size: 1.25rem; }
.section-title a { font-size: .85rem; color: var(--brand); font-weight: 600; }

/* ─── Tabs ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--light); margin-bottom: 24px; }
.tab {
  padding: 10px 20px; font-size: .875rem; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  color: var(--mid); transition: var(--transition); background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover  { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .875rem; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background: #DBEAFE; color: #1E3A8A; border: 1px solid #BFDBFE; }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer { background: var(--dark); color: rgba(255,255,255,.7); padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer h4 { color: var(--white); font-size: .9rem; font-weight: 700; margin-bottom: 14px; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer ul li a { font-size: .85rem; color: rgba(255,255,255,.6); transition: color var(--transition); }
.footer ul li a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; display: flex; align-items: center; justify-content: space-between; font-size: .8rem; }
.footer-bottom .logo { font-size: 1.1rem; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .chat-layout { grid-template-columns: 260px 1fr; }
}
@media (max-width: 768px) {
  :root { --header-h: 56px; }
  .header-inner { gap: 10px; }
  .search-bar { max-width: none; }
  .header-nav { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 36px 0; }
  .hero-stats { gap: 20px; }
  .hero-stat strong { font-size: 1.1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); }
  .categories-grid { grid-template-columns: repeat(auto-fill,minmax(80px,1fr)); }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-sidebar.show { display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: 500; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .admin-nav-item { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; padding: 8px 14px; }
  .admin-nav-item.active { border-bottom-color: var(--brand); border-left: none; }
  .admin-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-search { flex-direction: column; border-radius: var(--radius); }
  .hero-search input, .hero-search button { border-radius: 0; }
  .hero-search input { border-radius: var(--radius) var(--radius) 0 0; }
  .hero-search button { border-radius: 0 0 var(--radius) var(--radius); padding: 12px; }
  .pagination { flex-wrap: wrap; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 95vh; margin-top: auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ─── Utility ────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.text-mid { color: var(--mid); }
.text-brand { color: var(--brand); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.w-full { width: 100%; }
.lazy { opacity: 0; transition: opacity .4s ease; }
.lazy.loaded { opacity: 1; }
