/* =====================================================
   Attico — Styles
   ===================================================== */

/* --- Variables --- */
:root {
  --primary: #e91e8c;
  --primary-hover: #c4177a;
  --primary-light: #fce7f3;
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --success: #10B981;
  --warning: #F59E0B;

  --bg: #fff5f9;
  --surface: #FFFFFF;
  --surface-alt: #f9fafb;
  --sidebar-bg: #3b0429;
  --sidebar-text: #f9a8d4;
  --sidebar-active: #e91e8c;
  --sidebar-active-bg: rgba(233, 30, 140, 0.22);

  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-soft: #f3f4f6;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.18);

  --sidebar-w: 240px;
  --transition: 0.18s ease;
}

/* Dark theme */
body[data-theme="dark"] {
  --primary: #ec4899;
  --primary-hover: #f472b6;
  --primary-light: #4a0024;

  --bg: #1a0a14;
  --surface: #2d0a1f;
  --surface-alt: #1f0716;
  --sidebar-bg: #0a0508;
  --sidebar-text: #f9a8d4;
  --sidebar-active: #ec4899;
  --sidebar-active-bg: rgba(236, 72, 153, 0.28);

  --text: #fce7f3;
  --text-muted: #a78b9d;
  --border: #4a0024;
  --border-soft: #2d0a1f;

  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
}

/* Smooth theme transitions */
body, .item-card, .modal, .sidebar, .main, .filter-bar, .pill, .nav-item,
.shed-card, .bt-card, .cat-tile, .sell-panel, .sell-share-section,
.gs-header, .asset-stat-card, .asset-chart-box, .asset-table-wrap,
.bt-progress-wrap, .form-grid input, .form-grid select, .form-grid textarea,
input, textarea, select {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.08) rotate(-12deg);
}

/* Dark mode adjustments for white backgrounds we hard-coded */
body[data-theme="dark"] .item-card,
body[data-theme="dark"] .modal,
body[data-theme="dark"] .shed-card,
body[data-theme="dark"] .bt-card,
body[data-theme="dark"] .sell-panel,
body[data-theme="dark"] .sell-share-section,
body[data-theme="dark"] .asset-stat-card,
body[data-theme="dark"] .asset-chart-box,
body[data-theme="dark"] .asset-table-wrap,
body[data-theme="dark"] .bt-progress-wrap,
body[data-theme="dark"] .pill,
body[data-theme="dark"] .view-toggle,
body[data-theme="dark"] .category-pills-row {
  background: var(--surface);
  color: var(--text);
}
body[data-theme="dark"] .item-card .card-name,
body[data-theme="dark"] .detail-name,
body[data-theme="dark"] .modal-header h2,
body[data-theme="dark"] .home-title,
body[data-theme="dark"] .cat-tile-name,
body[data-theme="dark"] .shed-card-name,
body[data-theme="dark"] .bt-card-name,
body[data-theme="dark"] .asset-stat-value,
body[data-theme="dark"] .empty-state h3 {
  color: var(--text);
}
body[data-theme="dark"] .home-title {
  background: linear-gradient(135deg, var(--primary), #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.7); }
body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}
body[data-theme="dark"] .photo-drop {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-muted);
}
body[data-theme="dark"] .btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}
body[data-theme="dark"] .form-grid label,
body[data-theme="dark"] .detail-field label,
body[data-theme="dark"] .nav-label {
  color: var(--text-muted);
}
body[data-theme="dark"] .filter-divider,
body[data-theme="dark"] .pill-toggle {
  border-color: var(--border) !important;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 0 0 24px;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.logo-icon { font-size: 24px; }

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

.attico-owner-wrap {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.attico-of {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  font-style: italic;
}
.attico-name {
  font-size: 15px;
  font-weight: 700;
  color: #f9a8d4;
  cursor: pointer;
  border-bottom: 1px dashed rgba(249,168,212,0.4);
  transition: color 0.15s, border-color 0.15s;
}
.attico-name:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

/* Garage sale item picker */
.gs-picker-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 0 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gs-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid #f3f4f6;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.gs-picker-item:hover { border-color: var(--primary-light); background: #fff5f9; }
.gs-picker-item.selected { border-color: var(--primary); background: var(--primary-light); }
.gs-picker-item input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.gs-picker-thumb {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.gs-picker-placeholder {
  width: 40px; height: 40px; border-radius: 8px; background: #fce7f3;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.gs-picker-info { flex: 1; min-width: 0; }
.gs-picker-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-picker-cat { font-size: 12px; color: #9ca3af; }
.gs-picker-price { font-size: 13px; font-weight: 600; color: var(--primary); flex-shrink: 0; }
.gs-picker-empty { text-align: center; padding: 32px 20px; color: #9ca3af; font-size: 14px; }

/* Search */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 16px 8px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color var(--transition);
}

.search-wrap:focus-within {
  border-color: var(--primary);
}

.search-icon { font-size: 13px; opacity: 0.6; flex-shrink: 0; }

.search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: #FFFFFF;
  width: 100%;
  font-size: 13px;
}

.search-wrap input::placeholder { color: rgba(255,255,255,0.35); }

/* Nav */
.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 20px 6px;
}

.nav-label-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color 0.15s;
}
.nav-label-toggle:hover { color: rgba(255,255,255,0.65); }

.nav-chevron {
  display: inline-block;
  font-size: 9px;
  transition: transform 0.2s ease;
  width: 10px;
}

.nav-label-toggle.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-label-toggle.collapsed + ul { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-size: 13px;
  color: var(--sidebar-text);
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: #f9a8d4;
  font-weight: 600;
}

.nav-item-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item-text { flex: 1; }

.nav-count {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active .nav-count {
  background: var(--primary);
  color: #fff;
}

.nav-item-empty {
  padding: 6px 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  font-style: italic;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label { font-size: 12px; color: rgba(255,255,255,0.4); }
.stat-val { font-size: 13px; font-weight: 700; color: #fff; }

/* =====================================================
   MAIN
   ===================================================== */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 32px 32px 48px;
  overflow-y: auto;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.header-left h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.item-count-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* View toggle */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.view-btn {
  padding: 7px 11px;
  font-size: 16px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}

.view-btn:hover { background: var(--bg); }
.view-btn.active { background: var(--primary-light); color: var(--primary); }

/* Filter pills */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.pill:hover { border-color: var(--primary); color: var(--primary); }

.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.filter-divider {
  width: 1px;
  background: var(--border);
  margin: 0 4px;
  align-self: stretch;
  flex-shrink: 0;
}

.pill-toggle {
  margin-left: auto;
  border-style: dashed !important;
}
.pill-toggle .pill-toggle-arrow {
  display: inline-block;
  transition: transform 0.2s;
  margin-right: 2px;
}
.pill-toggle.active { background: var(--primary-light); color: var(--primary); border-style: solid !important; }

.category-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 24px;
  animation: catRowIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.category-pills-row.hidden { display: none; }

@keyframes catRowIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cat-pill {
  font-size: 12px;
  padding: 5px 13px;
}

/* =====================================================
   ITEMS GRID
   ===================================================== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  align-content: start;
  flex: 1;
}

.items-grid.list-view {
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-emoji { font-size: 64px; margin-bottom: 16px; }

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 320px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Item Card */
.item-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15,5,12,0.06);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  animation: cardIn 0.4s ease backwards;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.item-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 32px rgba(233,30,140,0.12), 0 4px 12px rgba(15,5,12,0.08);
  border-color: var(--primary-light);
}

.item-card:active {
  transform: translateY(-2px) scale(1.005);
  transition-duration: 0.1s;
}

.item-card .card-photo img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.item-card:hover .card-photo img { transform: scale(1.04); }

/* =====================================================
   FLIPPABLE ITEM CARD (with 3D icon)
   ===================================================== */

.item-card.has-icon {
  background: transparent;
  box-shadow: none;
  border: none;
  perspective: 1400px;
  height: 340px;
  overflow: visible;
}
.item-card.has-icon:hover {
  transform: translateY(-3px);
  box-shadow: none;
  border-color: transparent;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.item-card.has-icon.flipped .card-flip-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
}

.card-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 8px;
  background: transparent;
  box-shadow: none;
  border-radius: 14px;
}

.card-icon-stage {
  position: relative;
  width: 100%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stage shadow under the icon (matches home tiles) */
.card-icon-stage::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 14px;
  background: radial-gradient(ellipse, rgba(233,30,140,0.28), transparent 70%);
  filter: blur(6px);
  transition: width 0.4s ease, opacity 0.4s ease;
  z-index: -1;
}

.card-icon-image {
  max-width: 92%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(233,30,140,0.32));
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.45s ease;
  transform-origin: center bottom;
}

.item-card.has-icon:hover .card-icon-image {
  transform: scale(1.1) rotate(-3deg) translateY(-4px);
  filter: drop-shadow(0 28px 36px rgba(233,30,140,0.45));
}

.item-card.has-icon:hover .card-icon-stage::after {
  width: 85%;
  background: radial-gradient(ellipse, rgba(233,30,140,0.42), transparent 70%);
}

.card-icon-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  margin-top: 6px;
}
body[data-theme="dark"] .card-icon-name { color: var(--text); }

.card-icon-flip-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 5;
  opacity: 0;
}
.item-card.has-icon:hover .card-icon-flip-hint { opacity: 1; }
.card-icon-flip-hint:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: rotate(-180deg);
}

.card-back {
  transform: rotateY(180deg);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(15,5,12,0.1);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.card-back .card-photo {
  flex-shrink: 0;
}
.card-back .card-body {
  flex: 1;
  overflow: hidden;
}

.card-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  flex-shrink: 0;
}

.card-photo img { width: 100%; height: 100%; object-fit: cover; }

.card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
}

.tag.label-tag {
  background: #FEF3C7;
  color: #92400E;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-qty {
  font-size: 12px;
  color: var(--text-muted);
}

.card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  background: var(--bg);
}

.card-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition);
}

.card-btn.edit-btn {
  color: var(--primary);
  background: var(--primary-light);
}

.card-btn.edit-btn:hover { background: #DDD6FE; }

.card-btn.delete-btn {
  color: var(--danger);
  background: #FEF2F2;
}

.card-btn.delete-btn:hover { background: #FEE2E2; }

/* Low stock badge */
.low-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: #FEF3C7;
  color: #92400E;
}

/* List view card */
.items-grid.list-view .item-card {
  flex-direction: row;
  align-items: center;
}

.items-grid.list-view .card-photo {
  width: 72px;
  height: 72px;
  aspect-ratio: 1;
  flex-shrink: 0;
  font-size: 28px;
  border-radius: 0;
}

.items-grid.list-view .card-body {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.items-grid.list-view .card-name { flex: 1; min-width: 120px; }
.items-grid.list-view .card-tags { flex-wrap: nowrap; }
.items-grid.list-view .card-meta { margin-top: 0; gap: 16px; }

.items-grid.list-view .card-footer {
  border-top: none;
  border-left: 1px solid var(--border);
  background: none;
  padding: 0 12px;
  flex-shrink: 0;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--bg);
  color: var(--text-muted);
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  transition: background var(--transition);
}

.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition);
}

.btn-danger:hover { background: var(--danger-hover); }

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 5, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15,5,12,0.25), 0 4px 12px rgba(15,5,12,0.1);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  transition: background var(--transition);
  line-height: 1;
}

.modal-close:hover { background: var(--bg); color: var(--text); }

/* Photo upload */
.photo-section {
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.photo-drop {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 4/3;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  transition: border-color var(--transition), background var(--transition);
}

.photo-drop:hover { border-color: var(--primary); background: var(--primary-light); }
.photo-drop-icon { font-size: 32px; }

.photo-preview {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.remove-photo {
  font-size: 12px;
  color: var(--danger);
  text-decoration: underline;
}

.form-ai-photo-btn {
  display: block;
  margin: 12px auto 0;
  padding: 8px 18px;
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.form-ai-photo-btn:hover {
  background: linear-gradient(135deg, var(--primary) 0%, #f472b6 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(233,30,140,0.3);
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  padding: 20px 24px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: span 2; }

label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.required { color: var(--danger); }

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,30,140,0.12);
}

input.invalid, textarea.invalid, select.invalid {
  border-color: var(--danger);
}

.field-error {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

/* Detail modal */
.modal-detail { max-width: 560px; padding-bottom: 24px; }

.detail-photo {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.detail-photo img { width: 100%; height: 100%; object-fit: cover; }

.detail-body { padding: 20px 24px; }

.detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.detail-field span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* Confirm modal */
.modal-confirm {
  max-width: 360px;
  text-align: center;
  padding: 32px 24px 24px;
}

.confirm-icon { font-size: 40px; margin-bottom: 12px; }

.modal-confirm h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-confirm p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

.modal-confirm .modal-actions {
  justify-content: center;
  border-top: none;
  padding: 0;
}

/* =====================================================
   TOAST
   ===================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.toast-success { background: var(--success); }
.toast.toast-error { background: var(--danger); }

/* =====================================================
   AI FEATURES
   ===================================================== */

/* AI suggestion label */
.ai-suggesting {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}

/* AI filled banner */
.ai-filled-banner {
  margin: 0 24px 4px;
  padding: 8px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* Photo preview wrap + AI overlay */
.photo-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 200px;
}

.photo-preview {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.photo-ai-overlay {
  position: absolute;
  inset: 0;
  background: rgba(124, 58, 237, 0.75);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* Spinner */
.ai-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts bell ── */
.alerts-btn {
  position: relative;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #FEF3C7;
  transition: background var(--transition);
}

.alerts-btn:hover { background: #FDE68A; }

.alerts-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Alerts popover */
.alerts-popover {
  position: fixed;
  top: 70px;
  right: 32px;
  width: 280px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  z-index: 90;
  animation: slideUp 0.15s ease;
}

.alerts-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.alerts-popover-header button {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

#alertsList {
  padding: 8px 0;
  max-height: 240px;
  overflow-y: auto;
}

#alertsList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  gap: 8px;
}

#alertsList li:hover { background: var(--bg); }

.alert-item-name { font-weight: 600; flex: 1; }
.alert-item-qty {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #FEF3C7;
  color: #92400E;
  white-space: nowrap;
}

/* ── Chatbot ── */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(233,30,140,0.4);
  z-index: 80;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(233,30,140,0.5);
}

.chat-panel {
  position: fixed;
  bottom: 92px;
  right: 28px;
  width: 320px;
  height: 440px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 80;
  animation: slideUp 0.2s ease;
  overflow: hidden;
}

.chat-panel.hidden { display: none; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar { font-size: 22px; }

.chat-header strong { font-size: 14px; display: block; }

.chat-subtitle {
  font-size: 11px;
  opacity: 0.75;
  display: block;
}

.chat-close {
  color: rgba(255,255,255,0.8);
  font-size: 20px;
  line-height: 1;
}

.chat-close:hover { color: #fff; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  max-width: 88%;
}

.chat-msg span {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-msg.ai { align-self: flex-start; }
.chat-msg.ai span {
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg.user { align-self: flex-end; }
.chat-msg.user span {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.typing span {
  background: var(--bg);
  color: var(--text-muted);
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  outline: none;
}

.chat-input-row input:focus { border-color: var(--primary); }

.chat-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.chat-send:hover { background: var(--primary-hover); }
.chat-send:disabled { background: var(--border); cursor: not-allowed; }

/* =====================================================
   PHASE 5 — COLLECTOR / DIGITAL / ASSET / INSURANCE
   ===================================================== */

/* Collapsible form sections */
.form-section-extra {
  margin: 0 24px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.form-section-extra .form-grid {
  padding: 16px;
}

.form-section-title {
  padding: 10px 16px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.form-section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 24px 4px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
  user-select: none;
}

.form-section-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.toggle-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.form-section-toggle.open .toggle-arrow { transform: rotate(180deg); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* Asset badge on cards */
.asset-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: #FEF3C7;
  color: #92400E;
}

/* Insurance badge */
.insurance-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: #DCFCE7;
  color: #166534;
}

/* Digital item badge */
.digital-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: #fce7f3;
  color: #5B21B6;
}

/* Asset value in sidebar */
.stat-asset {
  padding: 8px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 8px;
}

/* Detail info extras */
.detail-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: var(--primary-light);
  color: var(--primary);
  transition: all var(--transition);
  margin-top: 4px;
}
.detail-link-btn:hover { background: var(--primary); color: #fff; }

/* Insurance expiry alert in popover */
.alert-insurance {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #DCFCE7;
  color: #166534;
  white-space: nowrap;
}

/* =====================================================
   PHASE 6 — SELL PREPARATION
   ===================================================== */

.sell-modal { max-width: 480px; }

/* Tabs */
.sell-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 0;
}

.sell-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.sell-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Listing result */
.sell-generate-prompt {
  text-align: center;
  padding: 16px 0 8px;
}

.sell-listing-field {
  margin-bottom: 12px;
}

.sell-listing-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sell-listing-value {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.sell-listing-value span { flex: 1; line-height: 1.5; }

.sell-copy-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sell-copy-btn:hover { background: var(--primary-light); }

.sell-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sell-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 600;
}

/* Platform links */
.sell-platform-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.sell-platform-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.sell-platform-btn.facebook { background: #1877F2; color: #fff; }
.sell-platform-btn.facebook:hover { background: #0d6efd; }
.sell-platform-btn.offerup { background: #FF6B00; color: #fff; }
.sell-platform-btn.offerup:hover { background: #e55f00; }
.sell-platform-btn.ebay { background: #E53238; color: #fff; }
.sell-platform-btn.ebay:hover { background: #cc2b30; }
.sell-platform-btn.craigslist { background: #6B6B6B; color: #fff; }
.sell-platform-btn.craigslist:hover { background: #555; }

/* Photo side-by-side */
.sell-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sell-photo-box { flex: 1; }

.sell-photo-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 6px;
}

.sell-photo-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sell-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Marketing photo uses white background */
#sellMarketingPhoto { background: #ffffff; }

.sell-photo-placeholder { font-size: 13px; color: var(--text-muted); text-align: center; }

.sell-photo-arrow { font-size: 20px; color: var(--text-muted); flex-shrink: 0; }

.sell-photo-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* Sell status badge */
.status-badge.for-sale { background: #FEF9C3; color: #854D0E; }

/* =====================================================
   PHASE 4 — SOCIAL FEATURES (GIFT / EXCHANGE / DONATE)
   ===================================================== */

/* Shared modal header */
.gift-modal-header {
  text-align: center;
  padding: 28px 24px 16px;
}
.gift-header-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.gift-modal-header h2 { font-size: 20px; margin-bottom: 4px; }
.gift-modal-header p { color: var(--text-muted); font-size: 13px; }

/* ── Gift modal ── */
.gift-modal { max-width: 420px; overflow: hidden; }

/* Envelope */
.envelope-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px 8px;
}

.envelope {
  position: relative;
  width: 280px;
  height: 180px;
  cursor: pointer;
}

.envelope-body {
  position: absolute;
  inset: 40px 0 0;
  background: linear-gradient(135deg, #fdf6ec, #fce8cc);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.envelope-seal {
  font-size: 32px;
  transition: opacity 0.4s ease;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  border-left: 140px solid transparent;
  border-right: 140px solid transparent;
  border-top: 100px solid #f5d8a8;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

.envelope.opened .envelope-flap {
  transform: rotateX(-180deg);
}

.envelope.opened .envelope-seal {
  opacity: 0;
}

/* Gift card (rises from envelope) */
.gift-card {
  width: 260px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
  margin-top: -20px;
}

.gift-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.gift-card-inner { display: flex; flex-direction: column; }

.gift-card-photo {
  height: 120px;
  background: linear-gradient(135deg, var(--primary-light), #fbcfe8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  overflow: hidden;
}

.gift-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gift-card-content {
  padding: 14px 16px;
  background: linear-gradient(to bottom, #fff9f9, #fff);
}

.gift-card-to {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.gift-card-item {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.gift-card-msg {
  font-size: 13px;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 8px;
  border-left: 2px solid #fbcfe8;
  padding-left: 8px;
}

.gift-card-from {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gift-card-brand {
  font-size: 10px;
  color: #d1d5db;
  text-align: right;
  margin-top: 4px;
}

/* Share section */
.share-section { padding: 16px 24px 8px; text-align: center; }
.share-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.share-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.share-btn.whatsapp { background: #25D366; color: #fff; }
.share-btn.whatsapp:hover { background: #1ebe5d; }
.share-btn.facebook { background: #1877F2; color: #fff; }
.share-btn.facebook:hover { background: #0d6efd; }
.share-btn.copy { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.share-btn.copy:hover { background: var(--border); }

/* ── Exchange modal ── */
.exchange-modal { max-width: 440px; }

.exchange-offering-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.exchange-offering-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
}

.exchange-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.exchange-tab {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  transition: all var(--transition);
  border: none;
}

.exchange-tab.active {
  background: var(--primary);
  color: white;
}

/* ── Donation modal ── */
.donate-modal { max-width: 400px; }

.donate-item-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 4px;
}

.donate-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.donate-places { display: flex; flex-direction: column; gap: 8px; }

.donate-place {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  font-size: 13px;
}

.donate-place:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.donate-place-icon { font-size: 22px; }
.donate-place-info { flex: 1; }
.donate-place-name { font-weight: 600; }
.donate-place-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.donate-place-arrow { color: var(--text-muted); font-size: 16px; }

/* Social status badges on item cards */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.status-badge.gifted { background: #FCE7F3; color: #9D174D; }
.status-badge.donated { background: #D1FAE5; color: #065F46; }
.status-badge.exchange-pending { background: #E0E7FF; color: #3730A3; }

/* =====================================================
   PHASE 3 — SMART SUGGESTIONS
   ===================================================== */

/* Smart action buttons inside detail modal */
.smart-actions {
  display: flex;
  gap: 10px;
  margin: 20px 0 4px;
  flex-wrap: wrap;
}

.btn-smart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-smart:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-smart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-smart-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #d97706;
}
.btn-smart-active:hover {
  background: #fde68a;
  border-color: #d97706;
  color: #b45309;
}

.btn-smart-ai {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.btn-smart-ai:hover {
  background: linear-gradient(135deg, var(--primary) 0%, #f472b6 100%);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(233,30,140,0.3);
}

/* Results panel */
.smart-results {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.smart-results-header {
  padding: 10px 16px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.smart-results-list {
  padding: 6px 0;
}

.smart-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  transition: background var(--transition);
}

.smart-result-item:hover { background: var(--bg); }

.smart-result-info { flex: 1; }
.smart-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.smart-result-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.smart-result-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--primary-light);
}
.smart-result-link:hover {
  background: var(--primary-light);
}

.smart-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Maintenance badge on item cards */
.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.maintenance-badge.overdue {
  background: #FEE2E2;
  color: #991B1B;
}

.maintenance-badge.due-soon {
  background: #FEF3C7;
  color: #92400E;
}

/* Maintenance alert in popover */
.alert-maintenance {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #FEE2E2;
  color: #991B1B;
  white-space: nowrap;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.hidden { display: none !important; }

/* Category color dots */
.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  body { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 50;
    transition: left var(--transition);
    width: var(--sidebar-w);
  }

  .sidebar.open { left: 0; }

  .main { padding: 20px 16px 48px; }

  .items-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: span 1; }
}

/* =====================================================
   ASSET DASHBOARD
   ===================================================== */

#assetDashboard {
  padding: 8px 0 48px;
}

.asset-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.asset-stat-card {
  background: #fff;
  border: 1px solid #fce7f3;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
  transition: transform 0.15s;
}
.asset-stat-card:hover { transform: translateY(-2px); }
.asset-stat-card.accent {
  background: linear-gradient(135deg, #e91e8c 0%, #f472b6 100%);
  color: #fff;
  border-color: transparent;
}
.asset-stat-card.accent .asset-stat-label { color: rgba(255,255,255,0.8); }

.asset-stat-icon { font-size: 28px; margin-bottom: 8px; }
.asset-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.1;
  margin-bottom: 4px;
}
.asset-stat-card.accent .asset-stat-value { color: #fff; }
.asset-stat-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.asset-charts {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
  margin-bottom: 28px;
}

.asset-chart-box {
  background: #fff;
  border: 1px solid #fce7f3;
  border-radius: 14px;
  padding: 20px 24px 24px;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
}

.asset-chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.asset-chart-wrap {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.asset-chart-wrap canvas { max-height: 240px; }

.asset-table-wrap {
  background: #fff;
  border: 1px solid #fce7f3;
  border-radius: 14px;
  padding: 20px 24px 8px;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
}

.asset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.asset-table th {
  text-align: left;
  padding: 8px 12px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #f3f4f6;
}
.asset-table td {
  padding: 12px 12px;
  border-bottom: 1px solid #f9fafb;
  color: #1a1a2e;
  vertical-align: middle;
}
.asset-table tr:last-child td { border-bottom: none; }
.asset-table tr:hover td { background: #faf5ff; }

.asset-item-name {
  font-weight: 600;
  color: #1a1a2e;
}
.asset-item-photo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}
.asset-item-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.asset-photo-placeholder {
  width: 36px;
  height: 36px;
  background: #fce7f3;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.asset-value-pill {
  display: inline-block;
  background: #f0fdf4;
  color: #16a34a;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 13px;
}
.asset-table-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}

@media (max-width: 900px) {
  .asset-stat-cards { grid-template-columns: repeat(2, 1fr); }
  .asset-charts { grid-template-columns: 1fr; }
}

/* =====================================================
   GARAGE SALE
   ===================================================== */

#garageSaleDashboard {
  padding: 8px 0 48px;
}

.gs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(245,158,11,0.2);
}

.gs-sale-info { display: flex; flex-direction: column; gap: 4px; }
.gs-sale-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.gs-sale-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}

.gs-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gs-header-actions .btn-secondary {
  background: rgba(255,255,255,0.25);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.gs-header-actions .btn-secondary:hover { background: rgba(255,255,255,0.4); }
.gs-header-actions .btn-primary {
  background: #fff;
  color: #d97706;
}
.gs-header-actions .btn-primary:hover { background: #fef3c7; }

.gs-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.gs-card {
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(245,158,11,0.1);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.gs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(245,158,11,0.18);
}

.gs-card-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #fef9ee;
  display: block;
}
.gs-card-photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.gs-card-body { padding: 12px 14px 14px; }
.gs-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-card-cat {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gs-card-price {
  font-size: 20px;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 10px;
}
.gs-card-remove {
  width: 100%;
  padding: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #ea580c;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.gs-card-remove:hover { background: #ffedd5; }

.gs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}
.gs-empty h3 { color: #4b5563; margin: 12px 0 8px; font-size: 18px; }
.gs-empty p { font-size: 14px; }

/* Share modal */
.gs-preview-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 20px;
  font-family: inherit;
}

.gs-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gs-share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  color: #fff;
}
.gs-share-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.gs-share-btn.whatsapp  { background: #25d366; }
.gs-share-btn.facebook  { background: #1877f2; }
.gs-share-btn.twitter   { background: #000; }
.gs-share-btn.instagram { background: linear-gradient(135deg,#f58529,#dd2a7b,#515bd4); }
.gs-share-btn.copy      { background: #6b7280; }

/* Garage sale badge on item card */
.gs-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 2;
}

@media (max-width: 700px) {
  .gs-header { flex-direction: column; align-items: flex-start; }
  .gs-items-grid { grid-template-columns: repeat(2, 1fr); }
}

.sell-card-with-remove { position: relative; }
.sell-card-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(239,68,68,0.4);
  transition: transform 0.1s;
}
.sell-card-remove:hover { transform: scale(1.15); }

/* Only show the X buttons when remove mode is active, and add a wiggle */
body.sell-remove-mode .sell-card-remove { display: flex; }
body.sell-remove-mode .sell-card-with-remove {
  animation: wiggle 0.6s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-1.2deg); }
  75% { transform: rotate(1.2deg); }
}

/* =====================================================
   360° SPIN VIEWER (Phase 7 Step 3)
   ===================================================== */

.spin-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(180deg, #fff5f9 0%, #fce7f3 100%);
  border-radius: 18px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -40px 80px -40px rgba(233,30,140,0.2);
}
.spin-stage:active { cursor: grabbing; }

.spin-image {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  pointer-events: none;
  user-drag: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,0.18));
  transition: opacity 0.18s ease;
}

.spin-angle-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spin-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}

.spin-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.spin-thumb {
  aspect-ratio: 1;
  background: var(--surface-alt, #f9fafb);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: all 0.18s;
  position: relative;
}
.spin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(180deg, #fff5f9, #fce7f3);
}
.spin-thumb:hover { transform: translateY(-2px); }
.spin-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(233,30,140,0.3);
}
.spin-thumb-label {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.85);
  padding: 1px 6px;
  border-radius: 8px;
}

.spin-controls {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: center;
}
.spin-controls button { font-size: 13px; }
.spin-controls .auto-on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* =====================================================
   IDENTIFY BRAND MODAL
   ===================================================== */

.identify-loading {
  text-align: center;
  padding: 40px 20px;
}

.identify-photo-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
#identifyPhoto {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  background: #f9fafb;
}

.identify-info { display: flex; flex-direction: column; gap: 6px; }
.identify-brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.identify-model {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
}
.identify-confidence {
  display: inline-block;
  width: fit-content;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
}
.identify-confidence.high { background: #dcfce7; color: #16a34a; }
.identify-confidence.medium { background: #fef3c7; color: #ca8a04; }
.identify-confidence.low { background: #fee2e2; color: #dc2626; }

.identify-meta-row { display: flex; gap: 6px; flex-wrap: wrap; }

.identify-tier {
  display: inline-block;
  width: fit-content;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.identify-tier.platinum {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #e0e7ff 100%);
  color: #312e81;
  border: 1px solid #a5b4fc;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
  position: relative;
  font-weight: 800;
}
.identify-tier.platinum::after {
  content: '💎';
  margin-left: 4px;
  font-size: 11px;
}
.identify-tier.luxury { background: linear-gradient(135deg,#fef3c7,#fcd34d); color: #92400e; }
.identify-tier.premium { background: linear-gradient(135deg,#fce7f3,#fbcfe8); color: var(--primary); }
.identify-tier.popular { background: #dbeafe; color: #1e40af; }
.identify-tier.budget { background: #f3f4f6; color: #6b7280; }

.identify-stars {
  display: flex;
  gap: 2px;
  font-size: 16px;
  color: #fbbf24;
  margin-top: 2px;
  align-items: center;
}
.identify-stars .empty { color: #e5e7eb; }

/* Platinum stars — sparkling diamond effect */
.identify-stars.platinum span:not(.empty) {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 30%, #ffffff 50%, #c7d2fe 70%, #e0e7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 8px rgba(199,210,254,0.8);
  animation: sparkle 2s ease-in-out infinite;
}
.identify-stars.platinum span:nth-child(2):not(.empty) { animation-delay: 0.2s; }
.identify-stars.platinum span:nth-child(3):not(.empty) { animation-delay: 0.4s; }
.identify-stars.platinum span:nth-child(4):not(.empty) { animation-delay: 0.6s; }
.identify-stars.platinum span:nth-child(5):not(.empty) { animation-delay: 0.8s; }

.identify-stars .platinum-badge {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #312e81;
  border: 1px solid #a5b4fc;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(165,180,252,0.6);
}

@keyframes sparkle {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 4px rgba(199,210,254,0.6)); }
  50% { filter: brightness(1.3) drop-shadow(0 0 12px rgba(199,210,254,1)); }
}

.identify-brand-about {
  font-size: 12px;
  color: var(--primary);
  font-style: italic;
  background: var(--primary-light);
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 4px;
  line-height: 1.4;
}

/* Brand banner shown in item detail view */
.detail-brand-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.detail-brand-banner.platinum {
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 50%, #e0e7ff 100%);
  border-color: #a5b4fc;
  box-shadow: 0 4px 16px rgba(165,180,252,0.3);
}
.detail-brand-banner.luxury {
  background: linear-gradient(135deg, #fef3c7, #fef9c3);
  border-color: #fcd34d;
}
.detail-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-brand-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.detail-brand-banner.platinum .detail-brand-name { color: #312e81; }
.detail-brand-banner.luxury .detail-brand-name { color: #92400e; }
.detail-brand-about {
  font-size: 12px;
  color: #4b5563;
  font-style: italic;
  margin-top: 8px;
  line-height: 1.5;
}

.identify-description {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  margin-top: 4px;
}

.identify-visible-text {
  font-size: 12px;
  color: #4b5563;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 8px;
  font-style: italic;
}

.identify-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 10px;
}

.identify-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.identify-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  transition: all 0.15s;
}
.identify-link:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

.identify-tip {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 14px;
  font-style: italic;
}

@media (max-width: 540px) {
  .identify-photo-row { grid-template-columns: 1fr; }
  #identifyPhoto { width: 100%; height: 200px; }
  .identify-links { grid-template-columns: 1fr; }
}

/* =====================================================
   QUICK AI PHOTO MODAL
   ===================================================== */

.quick-ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.quick-ai-cell { display: flex; flex-direction: column; gap: 6px; }
.quick-ai-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.quick-ai-photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #f9fafb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.quick-ai-photo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.quick-ai-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}
.quick-ai-empty p { margin-top: 6px; }

@media (max-width: 600px) {
  .quick-ai-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   SELECTION MODE
   ===================================================== */

.select-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.select-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-right: auto;
}
.select-action-bar .btn-secondary {
  font-size: 12px;
  padding: 6px 12px;
}
.select-action-bar .btn-primary {
  font-size: 12px;
  padding: 6px 14px;
}
.select-cancel { background: #fff !important; }

/* Selection circle on item cards */
.item-card .select-circle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 2px solid #e5e7eb;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

body.selection-mode .item-card { position: relative; }
body.selection-mode .item-card .select-circle { display: flex; }
body.selection-mode .item-card .card-footer { display: none; }
body.selection-mode .item-card.selected { box-shadow: 0 0 0 3px var(--primary); }
body.selection-mode .item-card.selected .select-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Bulk AI progress */
.bulk-progress-bar {
  width: 100%;
  height: 8px;
  background: #f3f4f6;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 4px;
}
.bulk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #f472b6);
  border-radius: 20px;
  transition: width 0.4s ease;
}

/* =====================================================
   SELL & MARKET
   ===================================================== */

#sellDashboard { padding: 8px 0 48px; }

.sell-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  margin-bottom: 24px;
}

.sell-panel {
  background: #fff;
  border: 1px solid #fce7f3;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
}

.sell-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 14px;
}

.sell-photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #f9fafb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sell-original-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sell-3d-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #f9fafb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sell3dCanvas {
  width: 100%;
  height: 100%;
}
#sell3dCanvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px;
  cursor: grab;
}
#sell3dCanvas canvas:active { cursor: grabbing; }

.sell-3d-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  text-align: center;
  font-size: 13px;
  pointer-events: none;
}
.sell-3d-empty p { margin-top: 8px; line-height: 1.6; }

.sell-3d-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  z-index: 10;
}
.sell-3d-loading small { color: #9ca3af; font-weight: 400; font-size: 12px; }

.sell-loader {
  width: 40px;
  height: 40px;
  border: 4px solid #fce7f3;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: sellSpin 0.8s linear infinite;
}
@keyframes sellSpin { to { transform: rotate(360deg); } }

.sell-bg-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.sell-bg-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-right: 4px;
}
.sell-bg-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  padding: 0;
}
.sell-bg-swatch:hover { transform: scale(1.1); }
.sell-bg-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }

.sell-style-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s;
}
.sell-style-btn:hover { border-color: var(--primary); color: var(--primary); }
.sell-style-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.sell-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.sell-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

.sell-share-section {
  background: #fff;
  border: 1px solid #fce7f3;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
}

.sell-listing-info {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.sell-listing-info textarea {
  resize: vertical;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

@media (max-width: 900px) {
  .sell-layout { grid-template-columns: 1fr; }
  .sell-listing-info { grid-template-columns: 1fr; }
}

/* =====================================================
   BAG TRIP STAGE (3D bag + floating category icons)
   ===================================================== */

.bag-trip-stage-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 20px;
}

.bag-trip-stage {
  position: relative;
  width: 320px;
  height: 280px;
}

.bag-trip-bag-icon {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  filter: drop-shadow(0 18px 28px rgba(233,30,140,0.25));
  animation: bagBounce 3s ease-in-out infinite;
}

.bag-trip-bag-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes bagBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

.bag-trip-floating-cats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bag-trip-cat {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary-light);
  box-shadow: 0 4px 14px rgba(233,30,140,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: catPopOut 4s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.2s;
}
.bag-trip-cat:hover { transform: scale(1.15); }
.bag-trip-cat img {
  width: 75%;
  height: 75%;
  object-fit: contain;
}
.bag-trip-cat-emoji { font-size: 26px; }

@keyframes catPopOut {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.bag-trip-stage-empty {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* =====================================================
   BAG TRIPS
   ===================================================== */

#bagTripsDashboard { padding: 8px 0 48px; }

/* Progress bar */
.bt-progress-wrap {
  background: #fff;
  border: 1px solid #fce7f3;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
}
.bt-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
  font-weight: 600;
}
.bt-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #fce7f3;
  border-radius: 20px;
  overflow: hidden;
}
.bt-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #f472b6 100%);
  border-radius: 20px;
  transition: width 0.4s ease;
}

/* Insurance banner */
.bt-insurance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #166534;
  gap: 12px;
}
.bt-edit-insure-btn {
  background: none;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #166534;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.bt-edit-insure-btn:hover { background: #dcfce7; }

/* Item list */
.bt-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bt-item-row {
  background: #fff;
  border: 1.5px solid #f3f4f6;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bt-item-row:hover { border-color: #fce7f3; box-shadow: 0 2px 8px rgba(233,30,140,0.08); }
.bt-item-row.packed { background: #fafafa; opacity: 0.7; }

.bt-check {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.bt-item-info { flex: 1; min-width: 0; }
.bt-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 2px;
}
.bt-item-row.packed .bt-item-name {
  text-decoration: line-through;
  color: #9ca3af;
}
.bt-item-desc { font-size: 12px; color: #9ca3af; }

.bt-item-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
}
.bt-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: #fce7f3;
  color: var(--primary);
}
.bt-tag.cat { background: #f3f4f6; color: #4b5563; }
.bt-tag.value { background: #f0fdf4; color: #16a34a; }
.bt-tag.insured { background: #ecfdf5; color: #059669; }

.bt-item-del {
  background: none;
  border: none;
  color: #d1d5db;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.bt-item-del:hover { color: #ef4444; background: #fee2e2; }

/* Trip cards */
.bt-card {
  background: #fff;
  border: 1.5px solid #fce7f3;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
}
.bt-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(233,30,140,0.12); border-color: var(--primary); }
.bt-card-emoji { font-size: 36px; margin-bottom: 10px; }
.bt-card-name { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; }
.bt-card-meta { font-size: 12px; color: #9ca3af; margin-bottom: 12px; }
.bt-card-progress {
  height: 6px;
  background: #fce7f3;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 8px;
}
.bt-card-progress-fill { height: 100%; background: var(--primary); border-radius: 20px; }
.bt-card-packed { font-size: 11px; color: #9ca3af; }

/* =====================================================
   MANAGE CATEGORIES
   ===================================================== */

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 4px;
  padding-left: 4px;
}
.home-section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.home-section-toggle:hover { background: var(--primary-light); }
.home-section-arrow {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.home-section-toggle.collapsed .home-section-arrow { transform: rotate(-90deg); }
#homeView .home-grid.collapsed { display: none; }

.home-manage-cats-btn {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 8px;
}

/* Floating Add Item button — bottom left of main content area */
.home-add-fab {
  position: fixed;
  bottom: 24px;
  left: calc(var(--sidebar-w) + 24px);
  background: linear-gradient(135deg, var(--primary), #f472b6);
  color: #fff;
  border: none;
  border-radius: 32px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(233,30,140,0.4);
  z-index: 50;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
}
.home-add-fab:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 12px 32px rgba(233,30,140,0.5);
}
.home-add-fab-label { font-size: 13px; }

.manage-cats-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
.manage-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.manage-cat-row:hover { border-color: var(--primary); }
.manage-cat-emoji {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 8px;
  background: var(--surface-alt, #f9fafb);
  flex-shrink: 0;
}
.manage-cat-emoji img { width: 100%; height: 100%; object-fit: contain; }
.manage-cat-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.manage-cat-fav {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 4px;
  transition: transform 0.15s;
  filter: grayscale(1) opacity(0.4);
}
.manage-cat-fav.on { filter: none; }
.manage-cat-fav:hover { transform: scale(1.2); }
.manage-cat-del {
  background: none;
  border: none;
  font-size: 14px;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.manage-cat-del:hover { background: #fee2e2; }

.cat-color-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cat-color-swatch:hover { transform: scale(1.1); }
.cat-color-swatch.active {
  box-shadow: 0 0 0 3px var(--primary);
  transform: scale(1.15);
}

/* =====================================================
   AVATAR (home showcase + editor)
   ===================================================== */

.home-avatar-section {
  display: flex;
  justify-content: center;
  margin: 12px 0 28px;
}

.home-avatar-stage {
  position: relative;
  width: 320px;
  height: 320px;
}

.home-avatar-btn {
  position: absolute;
  inset: 70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border: 3px solid var(--primary);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 12px 32px rgba(233,30,140,0.25);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  z-index: 2;
}
.home-avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 40px rgba(233,30,140,0.4);
}
.home-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
/* When using 3D icon style, contain instead of cover */
.home-avatar-btn img.is-3d-icon {
  object-fit: contain;
  object-position: center;
  padding: 8px;
}

.avatar-edit-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.2s;
}
.home-avatar-btn:hover .avatar-edit-hint { opacity: 1; }

/* Floating items around the avatar */
.avatar-floating-items {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.avatar-floating-item {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--primary-light);
  box-shadow: 0 6px 16px rgba(233,30,140,0.22);
  animation: avatarFloat 4s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.avatar-floating-item:hover {
  transform: scale(1.18);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(233,30,140,0.4);
}
.avatar-floating-item img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}
.avatar-floating-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes avatarFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Avatar editor modal */
.avatar-preview-large {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border: 3px solid var(--primary);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(233,30,140,0.25);
}
.avatar-preview-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.avatar-preview-large img.is-3d-icon {
  object-fit: contain;
  object-position: center;
  padding: 12px;
}

.avatar-style-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.avatar-style-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.avatar-style-btn:hover { border-color: var(--primary); color: var(--primary); }
.avatar-style-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.avatar-swatch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.avatar-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.avatar-swatch:hover { transform: scale(1.1); }
.avatar-swatch.active {
  box-shadow: 0 0 0 3px var(--primary);
  transform: scale(1.15);
}

.avatar-items-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt, #f9fafb);
}
.avatar-item-pick {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 2.5px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  transition: all 0.15s;
  position: relative;
  padding: 0;
}
.avatar-item-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-item-pick:hover { transform: scale(1.06); }
.avatar-item-pick.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(233,30,140,0.3);
}
.avatar-item-pick.selected::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tiny avatar in chatbot */
.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  border: 1.5px solid var(--primary);
  margin-right: 8px;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* =====================================================
   HOME VIEW — category tiles with 3D feel
   ===================================================== */

#homeView { padding: 8px 0 60px; }

.home-greeting {
  text-align: center;
  margin-bottom: 32px;
}
.home-hello {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.home-title {
  font-size: 32px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.home-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 4px;
  padding-left: 4px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 12px 0;
}

.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 20px;
  perspective: 600px;
}

.cat-tile-icon-wrap {
  position: relative;
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.cat-tile-icon {
  font-size: 88px;
  line-height: 1;
  filter: drop-shadow(0 18px 24px rgba(233,30,140,0.18));
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.45s ease;
  display: inline-block;
  transform-origin: center bottom;
}

.cat-tile-icon-3d {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(233,30,140,0.22));
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.45s ease;
  transform-origin: center bottom;
}

.cat-tile:hover .cat-tile-icon-3d {
  transform: scale(1.18) rotate(-4deg) translateY(-4px);
  filter: drop-shadow(0 28px 36px rgba(233,30,140,0.4));
}

/* "Stage" shadow under each icon */
.cat-tile-icon-wrap::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 14px;
  background: radial-gradient(ellipse, rgba(233,30,140,0.25), transparent 70%);
  filter: blur(6px);
  transition: width 0.4s ease, opacity 0.4s ease;
  z-index: -1;
}

.cat-tile-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.cat-tile-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  min-height: 30px;
}

.cat-tile-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

/* Hover — icon pops toward you, shadow grows */
.cat-tile:hover { transform: translateY(-6px); }
.cat-tile:hover .cat-tile-icon {
  transform: scale(1.18) rotate(-4deg) translateY(-4px);
  filter: drop-shadow(0 28px 36px rgba(233,30,140,0.4));
}
.cat-tile:hover .cat-tile-icon-wrap::after {
  width: 95px;
  background: radial-gradient(ellipse, rgba(233,30,140,0.45), transparent 70%);
}
.cat-tile:hover .cat-tile-count {
  background: var(--primary);
  color: #fff;
}

.cat-tile:active .cat-tile-icon {
  transform: scale(1.05);
  transition-duration: 0.1s;
}

/* Empty state for categories with 0 items */
.cat-tile.empty .cat-tile-icon { opacity: 0.4; }
.cat-tile.empty .cat-tile-count { opacity: 0.5; }

@media (max-width: 700px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-tile-icon { font-size: 64px; }
  .cat-tile-icon-wrap { height: 80px; }
}

/* =====================================================
   CATEGORIES OVERLAY
   ===================================================== */

.btn-categories {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-categories:hover {
  background: var(--primary);
  color: #fff;
}

.cat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 2, 8, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.cat-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cat-overlay-inner {
  background: #fff;
  border-radius: 24px;
  padding: 28px 28px 32px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  animation: slideUp 0.22s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.cat-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.cat-overlay-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
}
.cat-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.cat-close-btn:hover { background: #fce7f3; color: var(--primary); }

.cat-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px;
}

.cat-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.cat-icon-btn:hover { transform: scale(1.06); }
.cat-icon-btn:hover .cat-icon-square { box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

.cat-icon-square {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  transition: box-shadow 0.15s;
}

.cat-icon-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-align: center;
  line-height: 1.3;
  max-width: 90px;
}

.cat-count-badge {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

/* =====================================================
   SHED GROUPS
   ===================================================== */

#shedsDashboard { padding: 8px 0 48px; }

.sheds-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.sheds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.sheds-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}
.sheds-empty h3 { color: #4b5563; margin: 12px 0 8px; font-size: 18px; }
.sheds-empty p { font-size: 14px; }

/* Shed card */
.shed-card {
  background: #fff;
  border: 1.5px solid #fce7f3;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 1px 4px rgba(233,30,140,0.06);
}
.shed-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(233,30,140,0.12);
  border-color: var(--primary);
}
.shed-card-emoji { font-size: 36px; margin-bottom: 10px; }
.shed-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.shed-card-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 12px;
}
.shed-card-code {
  display: inline-block;
  background: #fce7f3;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.08em;
}

/* Shed detail */
.shed-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f3f4f6;
}
.shed-back-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.shed-back-btn:hover { border-color: var(--primary); color: var(--primary); }
.shed-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.shed-detail-emoji { font-size: 36px; }
.shed-detail-name {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 2px;
}
.shed-detail-code {
  font-size: 12px;
  color: #9ca3af;
}

/* Shed items grid */
.shed-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  align-content: start;
}

.shed-item-card {
  background: #fff;
  border: 1.5px solid #f3f4f6;
  border-radius: 14px;
  padding: 16px;
  transition: box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.shed-item-card:hover { box-shadow: 0 4px 12px rgba(233,30,140,0.1); }

.shed-item-owner {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.shed-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.shed-item-desc {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
  line-height: 1.4;
}
.shed-item-qty {
  display: inline-block;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
}
.shed-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.shed-need-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.shed-need-btn:hover { border-color: var(--primary); color: var(--primary); background: #fce7f3; }
.shed-need-btn.needed { background: #fce7f3; border-color: var(--primary); color: var(--primary); }
.shed-delete-btn {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid #fee2e2;
  background: #fff;
  font-size: 12px;
  color: #ef4444;
  cursor: pointer;
  transition: background 0.15s;
}
.shed-delete-btn:hover { background: #fee2e2; }

/* Event type picker */
.shed-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.shed-type-btn {
  padding: 10px 6px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.shed-type-btn:hover { border-color: var(--primary); color: var(--primary); }
.shed-type-btn.active { border-color: var(--primary); background: #fce7f3; color: var(--primary); }
