@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --black: #111110;
  --black-mid: #2A2A28;
  --black-light: #4A4A47;
  --accent: #111110;
  --white: #FAFAF8;
  --off-white: #F4F2EE;
  --border: #E4E0D8;
  --border-light: #EDEAE4;
  --text-dark: #111110;
  --text-mid: #5A5A56;
  --text-light: #9A9A94;
  --shadow-sm: 0 1px 4px rgba(17,17,16,0.06);
  --shadow-md: 0 4px 16px rgba(17,17,16,0.08);
  --shadow-lg: 0 12px 40px rgba(17,17,16,0.1);
  --radius: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* TYPOGRAPHY */
h1, h2, h3 {
  font-family: 'Libre Baskerville', serif;
  font-weight: 700;
  line-height: 1.15;
}

/* NAVBAR */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.navbar.dark {
  background: rgba(17,17,16,0.97);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}

.nav-logo-mark {
  width: 28px; height: 28px;
  background: var(--black);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Libre Baskerville', serif;
  font-weight: 700; font-size: 12px; color: var(--white);
  letter-spacing: -0.02em;
}

.navbar.dark .nav-logo-mark { background: var(--white); color: var(--black); }

.nav-logo-text {
  font-family: 'Libre Baskerville', serif;
  font-size: 16px; font-weight: 700;
  color: var(--black); letter-spacing: -0.01em;
}

.navbar.dark .nav-logo-text { color: var(--white); }

.nav-links {
  display: flex; align-items: center; gap: 36px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: 13px; font-weight: 400; letter-spacing: 0.01em;
  color: var(--text-mid);
  transition: color var(--transition);
}

.navbar.dark .nav-links a { color: rgba(250,250,248,0.6); }
.nav-links a:hover, .navbar.dark .nav-links a:hover { color: var(--black); }
.navbar.dark .nav-links a:hover { color: var(--white); }

.nav-actions {
  display: flex; align-items: center; gap: 10px;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  border: none; border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--black-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17,17,16,0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(250,250,248,0.3);
  color: var(--white);
}
.btn-outline:hover {
  border-color: var(--white);
  background: rgba(250,250,248,0.08);
}

.btn-outline-dark {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dark);
}
.btn-outline-dark:hover {
  border-color: var(--black);
  color: var(--black);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mid);
}
.btn-ghost:hover { background: var(--off-white); color: var(--black); border-color: var(--black); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 32px; font-size: 14px; }

/* BADGE */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 2px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.badge-dark { background: var(--black); color: var(--white); }
.badge-outline { background: transparent; color: var(--text-mid); border: 1px solid var(--border); }
.badge-green { background: #F0F7F4; color: #1A5C3A; border: 1px solid #C8E0D4; }
.badge-red { background: #FDF2F2; color: #8B2020; }
.badge-gold { background: #FAF5EA; color: #7A5C1E; border: 1px solid #E8D8B0; }

/* CARDS */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--black-light);
  box-shadow: var(--shadow-md);
}

/* PRODUCT CARD */
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.product-card:hover {
  border-color: #999;
  box-shadow: var(--shadow-md);
}
.product-card-img {
  width: 100%; aspect-ratio: 4/3;
  background: var(--off-white);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.product-card-img svg { width: 100%; height: 100%; display: block; }
.product-img-placeholder {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #EDEAE4 0px, #EDEAE4 3px,
    #F4F2EE 3px, #F4F2EE 10px
  );
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-light); gap: 8px;
}
.product-img-placeholder span { font-size: 10px; font-family: monospace; text-align: center; padding: 0 12px; color: var(--text-light); }
.product-card-body { padding: 14px 16px; }
.product-card-tag { font-size: 10px; color: var(--text-light); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 5px; }
.product-card-name { font-family: 'Libre Baskerville', serif; font-size: 16px; font-weight: 700; color: var(--black); margin-bottom: 3px; line-height: 1.3; }
.product-card-seller { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.product-card-price { font-size: 14px; font-weight: 600; color: var(--black); }
.product-card-moq { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border-light); }

/* SECTION */
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.container-sm { max-width: 960px; margin: 0 auto; padding: 0 48px; }

.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 10px;
}
.section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(32px, 3.5vw, 48px); font-weight: 700;
  color: var(--black); line-height: 1.15;
}
.section-title.light { color: var(--white); }
.section-sub {
  font-size: 15px; color: var(--text-mid); max-width: 520px; margin-top: 12px;
  line-height: 1.75;
}
.section-sub.light { color: rgba(250,250,248,0.6); }

/* GRID */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* FORM */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-dark); margin-bottom: 5px; letter-spacing: 0.02em; }
.form-input {
  width: 100%; padding: 9px 12px;
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-dark);
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--black); }
.form-input::placeholder { color: var(--text-light); }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M5 7L1 3h8z' fill='%239A9A94'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 90px; }

/* SIDEBAR LAYOUT */
.sidebar-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }

/* PORTAL SIDEBAR */
.portal-sidebar {
  background: var(--black);
  border-radius: var(--radius-md);
  padding: 20px;
  position: sticky; top: 84px;
}
.sidebar-logo {
  font-family: 'Libre Baskerville', serif;
  font-size: 16px; font-weight: 700; color: var(--white);
  margin-bottom: 28px; padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.sidebar-nav li a, .sidebar-nav li button {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  text-decoration: none; font-size: 13px; font-weight: 400;
  color: rgba(255,255,255,0.5);
  transition: all var(--transition);
  background: none; border: none; cursor: pointer; width: 100%; text-align: left;
}
.sidebar-nav li a:hover, .sidebar-nav li button:hover,
.sidebar-nav li.active a, .sidebar-nav li.active button {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

/* STATS */
.stat-card {
  padding: 24px; background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.stat-value {
  font-family: 'Libre Baskerville', serif;
  font-size: 34px; font-weight: 700; color: var(--black);
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.stat-change { font-size: 11px; color: #1A5C3A; font-weight: 500; margin-top: 3px; }

/* DIVIDER */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* CHAT */
.chat-bubble { max-width: 68%; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.chat-bubble.sent { background: var(--black); color: var(--white); border-radius: 10px 10px 2px 10px; margin-left: auto; }
.chat-bubble.received { background: var(--off-white); color: var(--text-dark); border-radius: 10px 10px 10px 2px; }

/* TAG */
.tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 2px; font-size: 11px; background: var(--off-white); color: var(--text-mid); border: 1px solid var(--border); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sidebar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .nav-links { display: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}
