*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color — mirrors website/styles.css (Fillo design system), do not fork values */
  --navy: #010A49;
  --navy-rgb: 1, 10, 73;
  --navy-soft: #131b5e;
  --accent: #F5A623;
  --accent-rgb: 245, 166, 35;
  --accent-soft: #FFE9C2;
  --accent-text: #8a5c0c;
  --bg: #ffffff;
  --bg-alt: #F7F8FC;
  --text: #0B1130;
  --muted: #5B6280;
  --border: #E7E9F5;
  --success: #1E9E6B;
  --danger: #C94B4B;
  --white: #ffffff;
  --white-rgb: 255, 255, 255;

  /* Radius / shadow / border-width */
  --radius-xs: 12px;
  --radius-sm: 14px;
  --radius-md: 16px;
  --radius: 20px;
  --radius-pill: 30px;
  --shadow: 0 24px 60px rgba(var(--navy-rgb), 0.10);
  --border-width: 1px;
  --border-width-thick: 2px;

  /* Motion */
  --transition-snappy: 0.1s;
  --transition-fast: 0.2s;
  --transition-slow: 0.3s;

  /* Type */
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', monospace;
  --text-2xs: 0.5rem;
  --text-xs: 0.72rem;
  --text-80: 0.8rem;
  --text-85: 0.85rem;
  --text-90: 0.9rem;
  --text-92: 0.92rem;
  --text-base: 0.95rem;
  --text-md: 1rem;
  --text-105: 1.05rem;
  --text-110: 1.1rem;
  --text-lg: 1.2rem;

  /* Spacing scale — literal px values, same convention as website/styles.css */
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-14: 14px;
  --space-16: 16px;
  --space-18: 18px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;

  --size-logo-toolbar: 56px;
  --side-nav-width: 72px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* SHELL — left icon rail (fixed) + main content column, layers.to-style. No right rail. */
.app-shell { display: flex; min-height: 100vh; }

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--side-nav-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-24);
  padding: var(--space-8) var(--space-8) var(--space-20);
  background: var(--bg-alt);
  border-right: var(--border-width) solid var(--border);
  z-index: 100;
}

.side-logo { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.logo-mark { width: var(--size-logo-toolbar); height: var(--size-logo-toolbar); display: block; }

.side-icons { display: flex; flex-direction: column; gap: var(--space-12); flex: 1; }

.side-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.side-icon:hover { background: rgba(var(--navy-rgb), 0.06); color: var(--navy); }
/* Persistent version of the hover look, for the nav item matching the page you're
   already on (this page is always /explore, so the explore icon carries it statically). */
.side-icon.active { background: rgba(var(--navy-rgb), 0.08); color: var(--navy); }

.main-content { flex: 1; min-width: 0; margin-left: var(--side-nav-width); }

/* TOPBAR — sticky "Hot" label + scrollable category chips + search, replaces the
   right-rail search box that layers.to has but that we deliberately don't. */
.content-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) var(--space-32);
  background: rgba(var(--white-rgb), 0.9);
  backdrop-filter: blur(12px);
}

.hot-label {
  flex-shrink: 0;
  background: var(--bg-alt);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-6) var(--space-14);
  font-size: var(--text-85);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.chip-row {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  background: var(--bg);
  border: var(--border-width) solid var(--border);
  color: var(--text);
  padding: var(--space-6) var(--space-14);
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--text-85);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.topbar-search { flex-shrink: 0; width: 240px; }
.topbar-search input {
  width: 100%;
  background: var(--bg-alt);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-8) var(--space-16);
  font-family: inherit;
  font-size: var(--text-90);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast);
}
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search input:focus { border-color: var(--navy); }

/* GRID — same density approach Vinted's own grid uses (tight 16px gutters, narrow
   cards) so 5 fit per row instead of 4, without changing the card's own content/shape. */
/* Fixed card width, not a fixed column count — a wider viewport fits more columns
   instead of stretching existing cards bigger. auto-fill computes how many 240px
   tracks fit and adds/removes columns as the window resizes; justify-content keeps any
   leftover fractional space as a trailing gap instead of distributing it into the cards
   (which repeat(N, 1fr) or minmax(240px, 1fr) would both do). */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  justify-content: start;
  gap: var(--space-16);
  padding: var(--space-8) var(--space-32) var(--space-24);
}

.item-card {
  background: var(--bg-alt);
  border: var(--border-width) solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.item-card:hover { border-color: var(--navy); transform: translateY(-4px); }
.item-card.is-new { border-color: var(--accent); }

.item-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--border);
  display: block;
}

/* Vinted-style hierarchy: brand (bold), then size/condition/added, then the listing's
   own title, then price last — large and colored, the card's one visual anchor at the
   bottom of the caption block instead of sharing top billing with the brand name. */
.item-body { padding: var(--space-14) var(--space-16) var(--space-18); }
.item-brand {
  font-weight: 600;
  font-size: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-meta { color: var(--muted); font-size: 12px; line-height: 16px; margin-top: var(--space-4); }
.item-title {
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  margin-top: var(--space-6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-price { font-size: 14px; font-weight: 600; color: var(--accent-text); margin-top: var(--space-8); }

.stale-banner {
  margin: 0 var(--space-32) var(--space-16);
  padding: var(--space-10) var(--space-16);
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
  font-size: var(--text-90);
}

@media (max-width: 600px) {
  .stale-banner { margin: 0 var(--space-16) var(--space-12); }
}

.load-more-wrap { text-align: center; padding: var(--space-8) var(--space-32) var(--space-24); }
.load-more {
  border: var(--border-width) solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: var(--space-10) var(--space-20);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.load-more:hover { border-color: var(--navy); }
.load-more:disabled { opacity: 0.6; cursor: wait; }

.hidden { display: none; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: var(--space-64) var(--space-24);
}

.footer {
  margin-top: var(--space-24);
  padding: var(--space-20) var(--space-32) var(--space-40);
  color: var(--muted);
  font-size: var(--text-80);
  text-align: center;
  border-top: var(--border-width) solid var(--border);
}
.footer a { color: var(--accent-text); font-weight: 600; }

@media (max-width: 700px) {
  .app-shell { flex-direction: column; }
  .side-nav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    padding: var(--space-10) var(--space-16);
    border-right: none;
    border-bottom: var(--border-width) solid var(--border);
  }
  .side-icons { flex-direction: row; flex: 0; }
  .main-content { margin-left: 0; }
  .content-topbar { flex-wrap: wrap; padding: var(--space-14) var(--space-20); }
  .topbar-search { order: 3; flex-basis: 100%; width: 100%; }
}

@media (max-width: 600px) {
  .item-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-14); padding: var(--space-16); }
}

/* AUTH / ACCOUNT MODALS + TOASTS — ported from website/styles.css verbatim (2026-07-14)
   so the rail's account icon behaves identically here and on /manager: a modal, not a
   navigation. Same design tokens, so this is a straight copy, not a re-derivation —
   keep both in sync if either changes. */

.btn-primary {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: var(--space-14) var(--space-24);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  transition: background var(--transition-fast), transform var(--transition-snappy);
}
.btn-primary:hover { background: var(--navy-soft); }
.btn-primary:active { transform: scale(0.98); }

.btn-small { padding: var(--space-10) var(--space-18); font-size: var(--text-85); border-radius: var(--radius-xs); }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(var(--navy-rgb), 0.5);
  z-index: 300; /* above .side-nav (100) unconditionally */
  align-items: center;
  justify-content: center;
  padding: var(--space-24);
}
.modal-overlay.open { display: flex; }

.modal {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-40);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide { max-width: 1100px; }

.alerts-admin-frame {
  width: 100%;
  height: 70vh;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
}

.modal-close {
  position: absolute;
  top: var(--space-16);
  right: var(--space-16);
  background: none;
  border: none;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.modal-close:hover { color: var(--navy); }

.modal-tabs {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-24);
  border-bottom: var(--border-width) solid var(--border);
}

.modal-tab {
  background: none;
  border: none;
  padding: var(--space-10) var(--space-4);
  margin-bottom: calc(var(--border-width) * -1);
  border-bottom: var(--border-width-thick) solid transparent;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.modal-tab.active { color: var(--navy); border-bottom-color: var(--accent); }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.auth-form input {
  background: var(--bg-alt);
  border: var(--border-width) solid var(--border);
  color: var(--text);
  padding: var(--space-14) var(--space-18);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}
.auth-form input:focus { border-color: var(--navy); }

.auth-error {
  color: var(--danger);
  font-size: var(--text-85);
  min-height: 1em;
}

.account-status-badge {
  display: inline-block;
  font-size: var(--text-85);
  font-weight: 600;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-24);
}
.account-status-badge.active { background: var(--accent-soft); color: var(--success); }
.account-status-badge.inactive { background: var(--bg-alt); color: var(--danger); }

.account-block { margin-bottom: var(--space-24); }

.account-block-label {
  font-size: var(--text-85);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-6);
}

.account-block p { font-size: var(--text-base); color: var(--muted); margin-bottom: var(--space-10); }

.account-paycode {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
}

.account-plan-amounts, .payments-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  font-size: var(--text-85);
  color: var(--muted);
}

.payments-empty { color: var(--muted); }

#toast-container {
  position: fixed;
  top: var(--space-24);
  right: var(--space-24);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-width: 360px;
}

.toast {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: var(--space-14) var(--space-40) var(--space-14) var(--space-18);
  font-size: var(--text-base);
  border-left: var(--border-width-thick) solid var(--muted);
  animation: toast-in 0.2s ease;
}
.toast-error { border-left-color: var(--danger); color: var(--text); }
.toast-success { border-left-color: var(--success); color: var(--text); }
.toast-info { border-left-color: var(--navy); color: var(--text); }

.toast-close {
  position: absolute;
  top: var(--space-10);
  right: var(--space-10);
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.toast-close:hover { color: var(--navy); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
