/* ═══════════════════════════════════════════
   CSS CUSTOM PROPERTIES (Light & Friendly)
   ═══════════════════════════════════════════ */
:root {
  /* Colors – Light & Soft */
  --bg-main: #f4f6f8;
  --bg-surface: #ffffff;
  --bg-elevated: #f8f9fa;
  --bg-hover: #e9ecef;
  --bg-active: #dee2e6;
  --bg-input: #f1f3f5;
  --bg-modal: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.3);

  --border-subtle: #e9ecef;
  --border-default: #dee2e6;
  --border-strong: #ced4da;

  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-tertiary: #adb5bd;
  --text-muted: #ced4da;

  --accent: #5c7cfa;
  --accent-light: #dbe4ff;
  --accent-hover: #4c6ef5;
  --accent-glow: rgba(92, 124, 250, 0.2);
  --accent-subtle: rgba(92, 124, 250, 0.08);

  --danger: #e03131;
  --danger-light: #ffe3e3;
  --success: #2b8a3e;

  --white: #ffffff;
  --black: #000000;

  /* Typography – Simple & Clean */
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --fs-xs: 0.7rem;
  --fs-sm: 0.8rem;
  --fs-base: 0.95rem;
  --fs-md: 1.1rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2rem;
  --fs-2xl: 2.6rem;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Borders & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows – Soft */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --sidebar-width: 220px;
  --builder-sidebar-width: 280px;
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-main);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--accent-hover);
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ═══════════════════════════════════════════
   VIEW SYSTEM
   ═══════════════════════════════════════════ */
.view {
  display: none;
  min-height: 100vh;
}
.view.active {
  display: flex;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  line-height: 1;
  position: relative;
  overflow: hidden;
  background-color: transparent;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(92, 124, 250, 0.2);
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(92, 124, 250, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  background-color: #3b5de7;
  transform: translateY(0);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-subtle);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.btn-danger {
  background-color: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger-light);
  color: #c92a2a;
  border-color: #c92a2a;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: var(--fs-xs);
}

/* ═══════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════ */
.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.field-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.field-input {
  width: 100%;
  padding: 11px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}
.field-input::placeholder {
  color: var(--text-muted);
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background-color: white;
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.field-row {
  display: flex;
  gap: var(--space-md);
}
.field-row > .field-group {
  flex: 1;
}

.auth-error,
.modal-error {
  font-size: var(--fs-xs);
  color: var(--danger);
  min-height: 18px;
  text-align: center;
  font-weight: var(--fw-medium);
}

/* ═══════════════════════════════════════════
   AUTH VIEW
   ═══════════════════════════════════════════ */
#view-auth {
  display: none;
}
#view-auth.active {
  display: flex;
}

.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Brand Side (now simple welcome) */
.auth-brand {
  flex: 1;
  background: linear-gradient(135deg, #e8edf5 0%, #f4f6f8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
}

.auth-brand-inner {
  text-align: center;
  z-index: 2;
  padding: var(--space-lg);
}

.brand-eyebrow {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.brand-logo {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
}

.brand-sub {
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Remove decorative circles */
.brand-decoration {
  display: none;
}

/* Auth Panel */
.auth-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  max-width: 520px;
  width: 100%;
}

.auth-form-wrap {
  width: 100%;
  max-width: 380px;
  padding: var(--space-2xl) var(--space-lg);
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-xl);
  background-color: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
  text-align: center;
}
.auth-tab.active {
  background-color: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}
.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

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

.auth-forgot {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-align: center;
  display: block;
  margin-top: var(--space-sm);
}
.auth-forgot:hover {
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background-color: white;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--duration-slow) var(--ease-out);
}

.sidebar-logo {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--accent);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}
.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}
.nav-item.active {
  color: var(--accent);
  background-color: var(--accent-subtle);
  font-weight: var(--fw-bold);
}
.nav-icon {
  font-size: var(--fs-md);
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  flex-shrink: 0;
}

.user-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: var(--fs-md);
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}
.btn-logout:hover {
  color: var(--danger);
  background-color: var(--danger-light);
}

/* ═══════════════════════════════════════════
   APP MAIN AREA
   ═══════════════════════════════════════════ */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-xl) var(--space-2xl);
  min-height: 100vh;
  background-color: var(--bg-main);
}

.page {
  display: none;
  animation: fadeSlideIn var(--duration-slow) var(--ease-out);
}
.page.active {
  display: block;
}

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

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.page-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: var(--fw-regular);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-tertiary);
  font-size: var(--fs-md);
  pointer-events: none;
}

.search-input {
  width: 220px;
  padding: 9px 14px 9px 36px;
  background-color: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  outline: none;
  transition: all var(--duration-fast) var(--ease-out);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  width: 260px;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.pill {
  padding: 7px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-full);
  background-color: white;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.pill.active {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-pills-sm .pill {
  padding: 5px 10px;
  font-size: 0.68rem;
}

/* ═══════════════════════════════════════════
   ITEMS GRID (Wardrobe)
   ═══════════════════════════════════════════ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

/* Item Card */
.item-card {
  background-color: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.item-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.item-card:active {
  transform: translateY(0);
}

.item-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.item-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}
.item-card:hover .item-card-image img {
  transform: scale(1.04);
}

.item-card-image .image-fallback {
  font-size: var(--fs-2xl);
  color: var(--text-muted);
}

.item-card-body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.item-card-name {
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.3;
}

.item-card-brand {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.item-card-price {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--accent);
  font-weight: var(--fw-medium);
}

.item-card-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  background-color: white;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  pointer-events: none;
}

.item-card-menu {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--duration-fast) var(--ease-out);
  pointer-events: none;
}
.item-card:hover .item-card-menu {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.item-card-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: white;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  transition: all var(--duration-fast) var(--ease-out);
}
.item-card-menu-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.item-card-menu-btn.btn-edit:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.item-card-menu-btn.btn-delete-item:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  background-color: white;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-xl);
  gap: var(--space-sm);
}

.empty-icon {
  font-size: var(--fs-2xl);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.empty-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.empty-sub {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* ═══════════════════════════════════════════
   OUTFITS GRID
   ═══════════════════════════════════════════ */
.outfits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.outfit-card {
  background-color: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.outfit-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.outfit-card-preview {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-md);
  background-color: var(--bg-elevated);
  min-height: 140px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.outfit-preview-item {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background-color: white;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
}
.outfit-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.outfit-preview-item.preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--fs-lg);
}

.outfit-card-info {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.outfit-card-name {
  font-weight: var(--fw-medium);
  font-size: var(--fs-base);
  color: var(--text-primary);
}

.outfit-card-desc {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.outfit-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.outfit-card-price {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: var(--fw-medium);
}

.outfit-card-actions {
  display: flex;
  gap: var(--space-xs);
  padding: 0 var(--space-md) var(--space-md);
}

/* ═══════════════════════════════════════════
   BUILDER LAYOUT
   ═══════════════════════════════════════════ */
.builder-layout {
  display: flex;
  gap: var(--space-lg);
  min-height: calc(100vh - 200px);
  align-items: flex-start;
}

.builder-sidebar {
  width: var(--builder-sidebar-width);
  flex-shrink: 0;
  background-color: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
  position: sticky;
  top: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.builder-sidebar-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.builder-sidebar-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.builder-item-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.builder-item-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  border: 1px solid transparent;
  background-color: var(--bg-elevated);
}
.builder-item-row:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-strong);
}
.builder-item-row.selected {
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}
.builder-item-row.added {
  opacity: 0.6;
  pointer-events: none;
  border-color: var(--border-subtle);
}

.builder-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: white;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.builder-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.builder-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.builder-item-name {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-item-meta {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  display: flex;
  gap: var(--space-sm);
}

.builder-item-price {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  flex-shrink: 0;
}

.builder-item-cat-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  background-color: var(--bg-input);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

/* Builder Canvas */
.builder-canvas-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.builder-canvas {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background-color: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  min-height: 500px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.canvas-slot {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 420px;
}

.canvas-slot-sm {
  max-width: 280px;
  margin-top: var(--space-sm);
}

.slot-label {
  width: 80px;
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  text-align: right;
}

.slot-content {
  flex: 1;
  min-height: 70px;
  background-color: var(--bg-elevated);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.slot-content:hover {
  border-color: var(--border-strong);
}
.slot-content.filled {
  border-style: solid;
  border-color: var(--border-strong);
  background-color: white;
}
.slot-content.highlight {
  border-color: var(--accent);
  border-style: solid;
  box-shadow: 0 0 0 4px var(--accent-light);
}

.canvas-slot-sm .slot-content {
  min-height: 56px;
}

.slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
}

.slot-plus {
  font-size: var(--fs-lg);
  font-weight: var(--fw-light);
  color: var(--text-tertiary);
}

.slot-item-preview {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  width: 100%;
}

.slot-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background-color: white;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow: hidden;
}
.slot-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-item-details {
  flex: 1;
  min-width: 0;
}

.slot-item-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-item-price {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
}

.slot-remove-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}
.slot-remove-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background-color: var(--danger-light);
}

/* Price Summary */
.price-summary {
  background-color: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  max-width: 420px;
  align-self: center;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.price-row-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-row-value {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.price-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.price-total-label {
  font-weight: var(--fw-medium);
  font-size: var(--fs-base);
  color: var(--text-primary);
}

.price-total-value {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--accent);
}

.price-budget-warning {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background-color: var(--danger-light);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  color: var(--danger);
  text-align: center;
  font-weight: var(--fw-medium);
}

.price-budget-warning.hidden {
  display: none;
}

/* Budget Bar */
.budget-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background-color: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 8px 4px 16px;
}

.budget-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.budget-symbol {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: var(--fw-medium);
}

.budget-input {
  width: 70px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  padding: 4px 0;
  outline: none;
}

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  padding: var(--space-lg);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: all var(--duration-normal) var(--ease-out);
}
.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}
.modal-sm {
  max-width: 400px;
}
.modal-lg {
  max-width: 700px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 10;
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: var(--fs-md);
  transition: all var(--duration-fast) var(--ease-out);
}
.modal-close:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.modal-form {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-body-text {
  padding: var(--space-xl);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
  text-align: center;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* Modal Image Upload */
.modal-image-upload {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 280px;
  background-color: var(--bg-elevated);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  overflow: hidden;
  position: relative;
}
.modal-image-upload:hover {
  border-color: var(--border-strong);
}
.modal-image-upload.has-image {
  border-style: solid;
  border-color: var(--border-strong);
}

.upload-placeholder {
  text-align: center;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.upload-icon {
  font-size: var(--fs-xl);
  color: var(--text-tertiary);
}

.upload-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.upload-sub {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.modal-image-upload.has-image .upload-preview {
  display: block;
}
.modal-image-upload.has-image .upload-placeholder {
  display: none;
}

/* Outfit Detail Modal */
.outfit-detail-body {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-xl);
}

.outfit-detail-items {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-md);
}

.outfit-detail-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.outfit-detail-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.outfit-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.outfit-detail-item-name {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.outfit-detail-item-price {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
}

.outfit-detail-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.detail-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.detail-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  font-size: var(--fs-sm);
}

.detail-total-row {
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-base);
  color: var(--text-primary);
}
.detail-total-row strong {
  font-family: var(--font-mono);
  color: var(--accent);
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.outfit-price-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background-color: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.outfit-price-preview strong {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: var(--fs-md);
}

/* ═══════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: white;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.toast.success .toast-icon {
  color: var(--success);
}
.toast.error .toast-icon {
  color: var(--danger);
}

.toast-icon {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.toast-msg {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════ */
.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ═══════════════════════════════════════════
   RESPONSIVE (same structure, lighter colors)
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 180px;
    --builder-sidebar-width: 240px;
  }

  .builder-layout {
    flex-direction: column;
  }

  .builder-sidebar {
    width: 100%;
    max-height: 300px;
    position: static;
  }

  .builder-item-list {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    gap: var(--space-sm);
  }

  .builder-item-row {
    flex: 0 0 auto;
    width: 160px;
    flex-direction: column;
    text-align: center;
  }

  .outfit-detail-body {
    flex-direction: column;
  }

  .outfit-detail-sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
    padding: var(--space-md);
  }

  .auth-split {
    flex-direction: column;
  }

  .auth-brand {
    min-height: 200px;
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .auth-panel {
    max-width: 100%;
    flex: 1;
  }

  .brand-logo {
    font-size: var(--fs-2xl);
  }

  .page-header {
    flex-direction: column;
    gap: var(--space-md);
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-input {
    width: 100%;
  }
  .search-input:focus {
    width: 100%;
  }

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

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

  .builder-canvas {
    padding: var(--space-md);
  }

  .canvas-slot {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
  }

  .slot-label {
    width: auto;
    text-align: left;
  }

  .modal {
    max-width: 95vw;
    max-height: 85vh;
    border-radius: var(--radius-lg);
  }

  .field-row {
    flex-direction: column;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .auth-form-wrap {
    padding: var(--space-lg) var(--space-md);
  }

  .brand-logo {
    font-size: var(--fs-xl);
  }

  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .outfits-grid {
    grid-template-columns: 1fr;
  }

  .filter-pills {
    gap: 4px;
  }

  .pill {
    padding: 5px 10px;
    font-size: 0.65rem;
  }
}