/* ============================================================
   Closet360 — App Styles
   Aesthetic: Refined luxury editorial — deep charcoal + warm ivory
   Fonts: Cormorant Garamond (display) + DM Sans (UI)
   ============================================================ */

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

:root {
  --bg:        #f7f5f2;
  --surface:   #ffffff;
  --surface2:  #f0ede8;
  --surface3:  #e8e4de;
  --border:    rgba(0,0,0,0.08);
  --border2:   rgba(0,0,0,0.14);

  --text:      #1a1814;
  --text2:     rgba(26,24,20,0.55);
  --text3:     rgba(26,24,20,0.3);

  --gold:      #b8892e;
  --gold-lt:   #d4a84b;
  --gold-dk:   #8a6520;
  --red:       #d94f4f;
  --green:     #3a9e6a;

  --radius:    14px;
  --radius-sm: 8px;
  --nav-h:     72px;
  --header-h:  58px;

  --shadow:    0 8px 32px rgba(0,0,0,0.10);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.07);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Screen system ────────────────────────────────────────── */
.screen { width: 100%; height: 100%; position: absolute; inset: 0; }

/* ══════════════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════════════ */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(184,137,46,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(180,160,120,0.08) 0%, transparent 60%),
    var(--bg);
}

.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 36px;
}

.logo-mark {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  color: var(--bg);
  flex-shrink: 0;
}

.logo-text {
  display: flex; flex-direction: column;
}
.logo-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 400; letter-spacing: 0.02em;
}
.logo-name em { font-style: italic; color: var(--gold); }
.logo-sub { font-size: 11px; color: var(--text2); letter-spacing: 0.08em; text-transform: uppercase; }

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1; padding: 10px;
  border: none; background: none; cursor: pointer;
  border-radius: 6px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  color: var(--text2); transition: all 0.2s;
}
.auth-tab.active {
  background: var(--surface3);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-error {
  margin-top: 12px;
  color: var(--red);
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

/* ══════════════════════════════════════════════
   MAIN APP SHELL
══════════════════════════════════════════════ */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── App Header ────────────────────────────── */
.app-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: rgba(247,245,242,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}

.header-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 18px; font-weight: 400;
}
.header-logo em { font-style: italic; color: var(--gold); }
.logo-mark-sm {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--bg);
}

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

.avatar-btn {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold-dk), var(--gold));
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  color: var(--bg); letter-spacing: 0.05em;
}

/* ── Main Content ──────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 8px);
  -webkit-overflow-scrolling: touch;
}

/* ── Bottom Nav ────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(247,245,242,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 0 4px;
}

.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  border: none; background: none; cursor: pointer; padding: 8px 4px;
  color: var(--text3); transition: color 0.2s;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span { font-size: 10px; letter-spacing: 0.04em; }
.nav-btn.active { color: var(--gold); }

.nav-btn-center { flex: 1.2; }
.center-btn-circle {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(201,169,110,0.35);
  margin-bottom: -2px;
}
.center-btn-circle svg { width: 22px; height: 22px; color: var(--bg); }
.nav-btn-center span { color: var(--text2); font-size: 10px; }
.nav-btn-center.active .center-btn-circle { box-shadow: 0 0 28px rgba(201,169,110,0.55); }

/* ══════════════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════════════ */
.field-group {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
}
.field-group label {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text2);
}
.field-group.half { flex: 1; }

.fields-row { display: flex; gap: 12px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-ui); font-size: 14px;
  outline: none; transition: border-color 0.2s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 60px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(240,237,230,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}
select option { background: var(--surface2); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dk) 100%);
  color: var(--bg);
  border: none; border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.sm { padding: 9px 18px; font-size: 13px; }
.btn-primary.full { width: 100%; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-family: var(--font-ui); font-size: 14px; font-weight: 400;
  cursor: pointer; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-outline.sm { padding: 8px 16px; font-size: 13px; }
.btn-outline.full { width: 100%; }
.btn-outline.danger { color: var(--red); border-color: rgba(232,93,93,0.3); }
.btn-outline.danger:hover { border-color: var(--red); background: rgba(232,93,93,0.08); }

.icon-btn {
  width: 36px; height: 36px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn.sm { width: 30px; height: 30px; font-size: 13px; }

.input-sm {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-ui); font-size: 13px;
  outline: none; width: 100%;
}
.select-sm {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 28px 8px 10px;
  color: var(--text);
  font-size: 13px; font-family: var(--font-ui);
  cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(240,237,230,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  appearance: none;
}

/* ── View containers ────────────────────────── */
.view { padding: 16px; }

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.view-header h1 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 400; letter-spacing: 0.01em;
}
.header-btns { display: flex; gap: 8px; }

/* ── Stats bar ──────────────────────────────── */
.stats-bar {
  display: flex; gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.stat {
  flex: 1;
  background: var(--surface);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px;
  gap: 2px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600; color: var(--gold);
}
.stat-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Filter pills ───────────────────────────── */
.filter-scroll {
  display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2); font-size: 13px;
  cursor: pointer; transition: all 0.18s;
  white-space: nowrap;
}
.pill.active { background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 500; }
.pill:hover:not(.active) { border-color: var(--gold); color: var(--gold); }

/* ── Toolbar ─────────────────────────────────── */
.toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.search-wrap {
  flex: 1; position: relative;
  display: flex; align-items: center;
}
.search-wrap svg {
  position: absolute; left: 12px; width: 16px; height: 16px;
  color: var(--text3); pointer-events: none;
}
.search-wrap input {
  padding-left: 38px;
}

/* ── Wardrobe grid ───────────────────────────── */
.wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 480px) { .wardrobe-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px) { .wardrobe-grid { grid-template-columns: repeat(4, 1fr); } }

.wardrobe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
  position: relative;
}
.wardrobe-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.wardrobe-card:active { transform: scale(0.98); }

.card-img {
  aspect-ratio: 3/4;
  overflow: hidden; position: relative;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.wardrobe-card:hover .card-img img { transform: scale(1.04); }
.card-img .no-img {
  font-size: 36px; opacity: 0.3;
}

.card-fav {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  background: rgba(247,245,242,0.85);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer;
  transition: transform 0.2s;
  border: none;
}
.card-fav:active { transform: scale(0.85); }

.card-info { padding: 10px 12px; }
.card-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta { font-size: 11px; color: var(--text2); margin-top: 2px; }
.card-tags {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px;
}
.tag-chip {
  font-size: 10px; padding: 2px 7px;
  background: var(--surface2); border-radius: 100px;
  color: var(--text2);
}

.card-nobg-badge {
  position: absolute; bottom: 8px; left: 8px;
  font-size: 10px; padding: 2px 8px;
  background: rgba(93,201,138,0.2); color: var(--green);
  border-radius: 100px; border: 1px solid rgba(93,201,138,0.3);
}

/* ── Add item button ────────────────────────── */
.btn-add {
  display: flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px dashed var(--gold-dk);
  color: var(--gold); border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-add svg { width: 16px; height: 16px; }
.btn-add:hover { background: rgba(201,169,110,0.08); }

/* ── Empty state ────────────────────────────── */
.grid-empty {
  grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; gap: 14px; text-align: center;
}
.empty-icon { font-size: 52px; opacity: 0.4; }
.grid-empty p { color: var(--text2); font-size: 14px; }

/* ══════════════════════════════════════════════
   OUTFIT BUILDER
══════════════════════════════════════════════ */
.builder-layout {
  display: flex; gap: 14px;
  min-height: 500px;
}

.canvas-panel {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
}

.view-switcher {
  display: flex; gap: 4px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.view-btn {
  flex: 1; padding: 7px 6px;
  border: none; background: none; cursor: pointer;
  border-radius: 5px;
  font-size: 12px; color: var(--text2);
  transition: all 0.18s;
}
.view-btn.active { background: var(--surface3); color: var(--gold); }

.body-canvas-wrap {
  flex: 1; position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 400px;
  display: flex; align-items: center; justify-content: center;
}
#outfit-canvas { max-width: 100%; max-height: 500px; display: block; }
.canvas-no-body {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: var(--surface);
}
.canvas-no-body p { color: var(--text2); font-size: 13px; }

.canvas-controls {
  display: flex; gap: 8px; justify-content: center;
}

.selector-panel {
  width: 140px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 10px;
}
@media (min-width: 500px) { .selector-panel { width: 160px; } }

.selector-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.sel-tab {
  flex: 1; min-width: 40%;
  padding: 6px 4px;
  border: 1px solid var(--border);
  background: none; cursor: pointer;
  border-radius: 6px; font-size: 11px; color: var(--text2);
  transition: all 0.18s;
}
.sel-tab.active { border-color: var(--gold); color: var(--gold); background: rgba(201,169,110,0.08); }

.selector-grid {
  flex: 1; overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  max-height: 440px;
}
.selector-card {
  aspect-ratio: 2/3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  cursor: pointer; transition: all 0.18s;
  position: relative;
}
.selector-card:hover, .selector-card.selected { border-color: var(--gold); }
.selector-card.selected::after {
  content: '✓';
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: var(--gold); color: var(--bg);
  border-radius: 50%; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.selector-card img { width: 100%; height: 100%; object-fit: cover; }

.selected-strip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.selected-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; }
.selected-items { display: flex; gap: 8px; overflow-x: auto; }
.selected-thumb {
  width: 40px; height: 56px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border2); flex-shrink: 0;
  position: relative; cursor: pointer;
}
.selected-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selected-thumb .remove-thumb {
  position: absolute; inset: 0;
  background: rgba(232,93,93,0.8);
  display: none; align-items: center; justify-content: center;
  font-size: 16px; color: white;
}
.selected-thumb:hover .remove-thumb { display: flex; }

/* ══════════════════════════════════════════════
   TRY-ON
══════════════════════════════════════════════ */
.tryon-layout {
  display: flex; gap: 14px;
  align-items: flex-start;
}

.tryon-body-panel {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
}

.tryon-view-switcher {
  display: flex; gap: 4px;
  background: var(--surface2);
  border-radius: var(--radius-sm); padding: 4px;
}

.tryon-body-frame {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 380px;
  display: flex; align-items: center; justify-content: center;
}
#tryon-body-img, #tryon-result-img {
  width: 100%; max-height: 450px; object-fit: contain;
  display: block;
}

.tryon-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
}
.tp-icon { font-size: 48px; opacity: 0.25; }
.tryon-placeholder p { color: var(--text2); font-size: 13px; }

.tryon-status {
  min-height: 32px;
  text-align: center; font-size: 13px; color: var(--text2);
}

.tryon-right {
  width: 150px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 500px) { .tryon-right { width: 170px; } }

.tryon-section-title {
  font-size: 11px; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.07em;
}

.tryon-item-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  max-height: 300px; overflow-y: auto;
}

.tryon-actions { display: flex; flex-direction: column; gap: 8px; }

.tryon-divider {
  text-align: center; font-size: 11px; color: var(--text3);
}

.quick-form { display: flex; flex-direction: column; gap: 6px; }

/* ══════════════════════════════════════════════
   SAVED LOOKS
══════════════════════════════════════════════ */
.header-tabs { display: flex; gap: 4px; }
.tab-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: none; cursor: pointer;
  border-radius: 100px; font-size: 13px; color: var(--text2);
  transition: all 0.18s;
}
.tab-btn.active { border-color: var(--gold); color: var(--gold); }

.looks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 480px) { .looks-grid { grid-template-columns: repeat(3, 1fr); } }

.look-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform 0.18s, border-color 0.18s;
}
.look-card:hover { transform: translateY(-2px); border-color: var(--border2); }

.look-preview {
  aspect-ratio: 3/4; overflow: hidden;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.look-preview img { width: 100%; height: 100%; object-fit: cover; }
.look-items-strip {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; padding: 6px;
  background: linear-gradient(to top, rgba(10,10,15,0.9), transparent);
  gap: 4px;
}
.look-item-dot {
  width: 28px; height: 36px;
  border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.look-item-dot img { width: 100%; height: 100%; object-fit: cover; }

.look-info { padding: 10px 12px; }
.look-name { font-size: 13px; font-weight: 500; }
.look-meta { font-size: 11px; color: var(--text2); margin-top: 2px; }
.look-fav { position: absolute; top: 8px; right: 8px; font-size: 16px; }

/* ══════════════════════════════════════════════
   BODY PROFILE
══════════════════════════════════════════════ */
.body-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
}
.body-form-card h2 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 400;
  margin-bottom: 20px;
}

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

.body-photo-slot { display: flex; flex-direction: column; }

.photo-drop-zone {
  aspect-ratio: 2/3;
  background: var(--surface2);
  border: 2px dashed var(--border2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.photo-drop-zone:hover { border-color: var(--gold); background: rgba(184,137,46,0.04); }
.photo-drop-zone.drag-over { border-color: var(--gold); background: rgba(184,137,46,0.08); }

.photo-drop-zone img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--radius-sm);
}

.drop-zone-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; color: var(--text2); text-align: center; padding: 12px;
  pointer-events: none;
}
.drop-zone-inner span { font-size: 13px; font-weight: 500; }
.drop-zone-inner small { font-size: 10px; color: var(--text3); }

.measurements-row { display: flex; gap: 12px; margin-bottom: 20px; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Profile card in list */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 12px; cursor: pointer;
  transition: border-color 0.18s;
}
.profile-card.active-profile { border-color: var(--gold); }
.profile-card:hover { border-color: var(--border2); }
.profile-thumbs { display: flex; gap: 4px; }
.profile-thumb {
  width: 36px; height: 54px;
  border-radius: 6px; overflow: hidden;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text3); flex-shrink: 0;
}
.profile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; }
.profile-label { font-size: 15px; font-weight: 500; }
.profile-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.profile-active-badge {
  font-size: 11px; color: var(--gold);
  border: 1px solid var(--gold-dk);
  border-radius: 100px; padding: 2px 10px;
}
.profile-actions { display: flex; gap: 6px; }

/* ══════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(26,24,20,0.45);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end;
  padding: 0;
  animation: fadeIn 0.18s ease;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 20px; }
}

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 24px 24px 0 0;
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  animation: slideUp 0.22s ease;
  overflow: hidden;
}
@media (min-width: 600px) {
  .modal { border-radius: 24px; max-width: 480px; max-height: 85vh; }
  .modal.modal-lg { max-width: 600px; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
  flex-shrink: 0;
}
.modal-header h2 {
  font-family: var(--font-display); font-size: 22px; font-weight: 400;
}
.modal-close {
  width: 32px; height: 32px;
  background: var(--surface2); border: none; border-radius: 50%;
  color: var(--text2); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--border); flex-shrink: 0;
}

/* Item image upload in modal */
.item-image-upload {
  aspect-ratio: 3/2;
  background: var(--surface2);
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  margin-bottom: 20px; overflow: hidden;
  cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.item-image-upload:hover { border-color: var(--gold); background: rgba(184,137,46,0.04); }
.upload-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text2);
}
.upload-placeholder svg { width: 40px; height: 40px; color: var(--text3); }
.upload-placeholder span { font-size: 13px; }
#item-img-preview { width: 100%; height: 100%; object-fit: contain; }

/* ══════════════════════════════════════════════
   DROPDOWN
══════════════════════════════════════════════ */
.dropdown {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: 12px;
  width: 220px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  z-index: 500;
  box-shadow: var(--shadow);
  animation: slideUp 0.15s ease;
  overflow: hidden;
}
.dropdown-user { padding: 14px 16px; }
.dropdown-user span { display: block; font-size: 14px; font-weight: 500; }
.dd-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.dd-divider { border: none; border-top: 1px solid var(--border); margin: 0; }
.dd-item {
  display: block; width: 100%;
  padding: 11px 16px;
  background: none; border: none; cursor: pointer;
  text-align: left; color: var(--text); font-size: 13px;
  transition: background 0.15s;
}
.dd-item:hover { background: var(--surface3); }
.dd-item.danger { color: var(--red); }

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 100px;
  padding: 10px 22px;
  font-size: 13px; color: var(--text);
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: all 0.25s;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(93,201,138,0.5); color: var(--green); }
.toast.error { border-color: rgba(232,93,93,0.5); color: var(--red); }

/* ══════════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════════ */
.loading-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(247,245,242,0.88);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
}
.loading-content {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.loading-spinner {
  width: 44px; height: 44px;
  border: 2px solid var(--border2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-content p { font-size: 14px; color: var(--text2); }

/* ══════════════════════════════════════════════
   ITEM DETAIL BODY
══════════════════════════════════════════════ */
.detail-layout {
  display: flex; gap: 18px;
}
.detail-img-wrap {
  width: 140px; flex-shrink: 0;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface2);
}
.detail-img-wrap img { width: 100%; display: block; }
.detail-info { flex: 1; }
.detail-row { margin-bottom: 10px; }
.detail-row .label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.07em; }
.detail-row .value { font-size: 14px; margin-top: 2px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

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

/* ══════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════ */
.hidden { display: none !important; }
.gold { color: var(--gold); }
.text2 { color: var(--text2); }
