/* =====================================================
   CPX DESIGN SYSTEM — REFINED GLASSMORPHISM
   Version: v1.1.1 (UI Consistency Pass)
===================================================== */

/* ===============================
   DESIGN TOKENS
================================ */
:root {
  --bg-main: radial-gradient(circle at top, #0f172a, #020617 70%);
  --bg-surface: rgba(255, 255, 255, 0.06);
  --bg-surface-strong: rgba(255, 255, 255, 0.10);

  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-primary: #ffffff;
  --text-muted: #9aa4c7;
  --text-soft: #cbd5f5;

  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.25);

  --success: #22c55e;
  --warning: #facc15;
  --danger: #ef4444;

  --blur-md: blur(14px);
  --blur-lg: blur(18px);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 18px 45px rgba(0, 0, 0, 0.55);
}

/* ===============================
   GLOBAL RESET
================================ */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===============================
   TYPOGRAPHY
================================ */
h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 16px;
}

h2 {
  font-size: 1.9rem;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

p {
  color: var(--text-soft);
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* ===============================
   LAYOUT HELPERS
================================ */
.container {
  max-width: 1100px;
  margin: auto;
  padding: 60px 20px;
}

.center {
  text-align: center;
}

.hidden {
  display: none;
}

/* ===============================
   HEADER
================================ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 10, 25, 0.92);
  backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.top-nav a {
  margin: 0 14px;
  font-size: 14px;
  color: var(--text-muted);
  position: relative;
}

.top-nav a:hover,
.top-nav a.active {
  color: var(--text-primary);
}

.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.top-nav a:hover::after,
.top-nav a.active::after {
  width: 100%;
}

/* ===============================
   CARD SYSTEM
================================ */
.card {
  background: var(--bg-surface);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  margin-bottom: 20px;
}

.card.subtle {
  background: rgba(255, 255, 255, 0.04);
}

.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

/* ===============================
   BUTTON SYSTEM (CANONICAL)
================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  backdrop-filter: var(--blur-md);
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--bg-surface-strong);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.35),
    rgba(56, 189, 248, 0.15)
  );
  border-color: var(--accent-soft);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(56, 189, 248, 0.45);
}

.btn-secondary {
  background: var(--bg-surface);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 26px;
  font-size: 15px;
}

/* ===============================
   BADGES & STATUS LABELS
================================ */
.badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  backdrop-filter: var(--blur-md);
}

.status-label {
  font-size: 12px;
  font-weight: 600;
}

.status-label.success {
  color: var(--success);
}

.status-label.warning {
  color: var(--warning);
}

.status-label.error {
  color: var(--danger);
}

/* ===============================
   MARKETPLACE TABS
================================ */
.tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active,
.tab:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* ===============================
   PRODUCT GRID
================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.product {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ===============================
   FILTER BAR
================================ */
.filter-bar {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.filter-bar input,
.filter-bar select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* ===============================
   ORDERS UI
================================ */
.order-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===============================
   EMPTY STATE
================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 900px) {
  .filter-bar {
    grid-template-columns: 1fr;
  }
}
