:root {
    /* Color Palette */
    --bg-base: #0a0908;
    --bg-surface: #121110;
    --bg-elevated: #1a1816;
    --bg-hover: #252220;
    --bg-overlay: rgba(10, 9, 8, 0.85);
    
    /* Text Colors */
    --text-primary: #faf8f6;
    --text-secondary: #b8b0a8;
    --text-tertiary: #8a827a;
    --text-muted: #605b56;
    
    /* Accent Colors */
    --accent: #b8796f;
    --accent-hover: #c68d83;
    --accent-muted: #8e5a51;
    --accent-subtle: rgba(184, 121, 111, 0.08);
    --accent-glow: rgba(184, 121, 111, 0.2);
    
    /* Status Colors */
    --success: #4a7c59;
    --success-bg: rgba(74, 124, 89, 0.1);
    --error: #c65d5d;
    --error-bg: rgba(198, 93, 93, 0.1);
    
    /* Borders */
    --border-subtle: rgba(250, 248, 246, 0.06);
    --border-light: rgba(250, 248, 246, 0.1);
    --border-medium: rgba(250, 248, 246, 0.15);
    
    /* Spacing */
    --space-2xs: 0.125rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-display: 'Crimson Text', Georgia, serif;
    --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    
    /* Animations */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    
    /* Shadows */
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.12);
    --shadow-medium: 0 8px 40px rgba(0, 0, 0, 0.16);
    --shadow-large: 0 24px 64px rgba(0, 0, 0, 0.24);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Layout */
    --header-height: 4rem;
    --content-max-width: 1280px;
    --card-radius: 0.75rem;
    --button-radius: 0.5rem;
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; font-weight: 300; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }

p {
    line-height: 1.7;
    color: var(--text-secondary);
}

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

/* ============================================
   AUTH SCREEN
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: 
        radial-gradient(ellipse at top, var(--bg-elevated) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, var(--accent-subtle) 0%, transparent 60%),
        var(--bg-base);
}

.login-box {
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: authReveal 0.8s var(--ease-out);
}

@keyframes authReveal {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-mark {
    width: 88px;
    height: 88px;
    margin: 0 auto var(--space-2xl);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-muted) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 300;
    color: white;
    box-shadow: var(--shadow-large);
    position: relative;
    overflow: hidden;
}

.logo-mark::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.login-box h1 {
    margin-bottom: var(--space-sm);
}

.login-box input[type="password"] {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: var(--space-md);
    transition: all 0.3s var(--ease-out);
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-muted);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-soft);
}

.login-box button {
    width: 100%;
    padding: 1rem 1.25rem;
}

/* ============================================
   USER SELECTION SCREEN
   ============================================ */

.user-selection-screen {
    min-height: 100vh;
    background: radial-gradient(ellipse at top, var(--bg-elevated) 0%, transparent 60%), var(--bg-base);
    padding: var(--space-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-selection-container {
    max-width: 800px;
    width: 100%;
    animation: fadeInUp 0.6s var(--ease-out);
}

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

.user-selection-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.user-selection-header h1 {
    margin-bottom: var(--space-sm);
}

.user-selection-header p {
    color: var(--text-tertiary);
    font-size: 1.125rem;
}

.user-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.user-select-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-subtle);
    border-radius: var(--card-radius);
    padding: var(--space-xl);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.user-select-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-muted) 100%);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-out);
}

.user-select-card:hover {
    border-color: var(--accent-muted);
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.user-select-card:hover::before {
    transform: scaleX(1);
}

.user-select-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-muted) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: white;
    box-shadow: var(--shadow-soft);
}

.user-select-name {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.user-select-meta {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ============================================
   BUTTONS
   ============================================ */

button {
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    border: none;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-muted) 100%);
    color: white;
    border-radius: var(--button-radius);
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium), 0 10px 30px var(--accent-glow);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--button-radius);
    font-size: 0.9375rem;
}

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

.btn-ghost {
    padding: var(--space-sm);
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--button-radius);
}

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

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-radius: var(--button-radius);
    color: white;
}

.btn-icon:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* ============================================
   NAVIGATION
   ============================================ */

header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 var(--space-2xl);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-mark.small {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
    border-radius: 12px;
    margin: 0;
}

.nav-brand span {
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.user-menu {
    position: relative;
}

.menu-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.menu-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--card-radius);
    min-width: 240px;
    box-shadow: var(--shadow-large);
    overflow: hidden;
    z-index: 1000;
}

.dropdown-item {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all 0.2s var(--ease-out);
}

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

.dropdown hr {
    height: 1px;
    background: var(--border-subtle);
    border: none;
    margin: 0;
}

/* ============================================
   AI ASSISTANT
   ============================================ */

.ai-bar {
    padding: var(--space-xl) var(--space-2xl);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.ai-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: 840px;
    margin: 0 auto;
    position: relative;
}

.ai-input-wrapper input {
    flex: 1;
    padding: 1rem 1.25rem 1rem 3.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.3s var(--ease-out);
}

.ai-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.ai-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-muted);
    background: var(--bg-hover);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.ai-response {
    max-width: 840px;
    margin: var(--space-lg) auto 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--card-radius);
    overflow: hidden;
    animation: slideDown 0.3s var(--ease-out);
}

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

.ai-response-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(to right, var(--accent-subtle), transparent);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.ai-response-header span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-response-header .btn-ghost {
    margin-left: auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border-radius: 6px;
}

.ai-response-content {
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.9375rem;
}

.ai-response-content h1,
.ai-response-content h2,
.ai-response-content h3,
.ai-response-content h4 {
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.ai-response-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.ai-response-content p {
    margin-bottom: 1rem;
}

.ai-response-content ul,
.ai-response-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.ai-response-content li {
    margin-bottom: 0.5rem;
}

.ai-response-content hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.5rem 0;
}

/* AI Outfit Suggestions */
.ai-outfit-suggestion {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.ai-outfit-suggestion:hover {
    border-color: var(--accent-muted);
    background: var(--bg-hover);
}

.ai-outfit-items {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.ai-outfit-item {
    padding: 0.25rem 0.5rem;
    background: var(--bg-elevated);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.ai-outfit-action {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   CATEGORY MANAGER
   ============================================ */

   .category-manager-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    transition: all 0.2s var(--ease-out);
}

.category-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.category-item-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.category-item-remove {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--button-radius);
    color: var(--text-tertiary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.category-item-remove:hover {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
}

.category-add-form {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border: 2px dashed var(--border-light);
    border-radius: var(--card-radius);
}

.category-add-form input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.3s var(--ease-out);
}

.category-add-form input:focus {
    outline: none;
    border-color: var(--accent-muted);
    background: var(--bg-hover);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.category-add-form button {
    padding: 0.875rem 1.75rem;
    white-space: nowrap;
}
/* ============================================
   OUTFIT BUILDER
   ============================================ */

   .outfit-builder-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--bg-elevated);
    border: 2px solid var(--accent-muted);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    z-index: 50;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.outfit-builder-toggle:hover {
    transform: scale(1.08);
    background: var(--accent);
    color: white;
}

.outfit-builder-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 2px solid var(--accent-muted);
    max-height: 50vh;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-out);
    z-index: 100;
    overflow: hidden;
}

.outfit-builder-panel.active {
    transform: translateY(0);
}

.outfit-builder-header {
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.outfit-builder-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.outfit-builder-actions {
    display: flex;
    gap: var(--space-sm);
}

.outfit-builder-content {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: calc(50vh - 80px);
}
.outfit-builder-panel.fullscreen .outfit-builder-content {
    max-height: calc(100vh - 80px);
    flex: 1;
}
.outfit-rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.outfit-row {
    background: var(--bg-elevated);
    border-radius: var(--card-radius);
    padding: var(--space-lg);
    border: 1px solid var(--border-subtle);
}

.outfit-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.outfit-name-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--button-radius);
    transition: all 0.2s var(--ease-out);
}

.outfit-name-input:hover,
.outfit-name-input:focus {
    background: var(--bg-surface);
    border-color: var(--border-light);
    outline: none;
}

.outfit-row-actions {
    display: flex;
    gap: var(--space-xs);
}

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

.outfit-slot {
    aspect-ratio: 3/4;
    background: var(--bg-surface);
    border: 2px dashed var(--border-light);
    border-radius: var(--button-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.outfit-slot::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-subtle), transparent);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

.outfit-slot:hover::before {
    opacity: 1;
}

.outfit-slot:hover {
    border-color: var(--accent-muted);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.outfit-slot:active {
    transform: scale(0.98);
}

.outfit-slot.filled {
    border-style: solid;
    border-color: var(--border-medium);
}

.outfit-slot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.outfit-slot-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: var(--space-sm);
    font-size: 0.75rem;
    text-align: center;
}

.outfit-slot-placeholder {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.outfit-slot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.outfit-slot.filled:hover .outfit-slot-remove {
    opacity: 1;
}

.add-outfit-row {
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border: 2px dashed var(--border-light);
    border-radius: var(--card-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.add-outfit-row:hover {
    border-color: var(--accent-muted);
    background: var(--bg-hover);
}

/* Item Selector Modal */
.item-selector-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.item-selector-modal .modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s var(--ease-out);
    z-index: -1; /* ADD THIS - puts backdrop behind content */
}

.item-selector-content {
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    background: var(--bg-surface);
    border-radius: var(--card-radius);
    overflow: hidden;
    animation: modalSlideUp 0.4s var(--ease-out);
    box-shadow: var(--shadow-large);
    position: relative;
    z-index: 1; /* Ensure content is above backdrop */
}

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

.item-selector-header {
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-selector-filters {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.item-selector-filters button {
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.item-selector-filters button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.item-selector-filters button:hover::before {
    left: 100%;
}

.item-selector-filters button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.item-selector-filters button:not(.active):hover {
    transform: translateY(-2px);
}

.item-selector-grid {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: calc(80vh - 200px);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Increased from 120px */
    gap: var(--space-lg); /* Increased gap */
}

.item-selector-item {
    background: var(--bg-elevated);
    border-radius: var(--button-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border: 2px solid transparent;
    animation: itemFadeIn 0.4s var(--ease-out) backwards;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure full height */
}

.item-selector-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-surface);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-selector-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease-out);
}

.item-selector-info {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.item-selector-name {
    font-size: 0.75rem; /* Reduced from 0.8125rem */
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Allow 2 lines */
    line-clamp:2;
    -webkit-box-orient: vertical;
}

.item-selector-color {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem; /* Reduced from 0.6875rem */
    color: var(--text-tertiary);
    margin-top: auto; /* Push to bottom */
}

/* Saved Outfits */
.saved-outfits-section {
    margin-top: var(--space-2xl);
    padding-top: var(--space-2xl);
    border-top: 2px solid var(--border-subtle);
}

.saved-outfits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.saved-outfit-card {
    background: var(--bg-elevated);
    border-radius: var(--card-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border: 1px solid var(--border-subtle);
}

.saved-outfit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.saved-outfit-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    aspect-ratio: 1;
    background: var(--bg-surface);
}

.saved-outfit-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-outfit-info {
    padding: var(--space-md);
}

.saved-outfit-name {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.saved-outfit-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Outfit View Toggle */
.view-toggle {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--bg-surface);
    border-radius: var(--button-radius);
}

.view-toggle button {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--button-radius);
    transition: all 0.2s;
}

.view-toggle button.active {
    background: var(--bg-elevated);
    color: var(--accent);
}

@media (max-width: 768px) {
    .outfit-builder-panel {
        max-height: 70vh;
    }
    
    .outfit-slots {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .item-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ============================================
   FILTER SECTION
   ============================================ */

.filter-bar {
    padding: 1rem var(--space-2xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: relative;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.filter-chips {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    flex: 1;
}

.filter-chip {
    padding: 0.375rem 0.875rem;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-muted);
    border-radius: 20px;
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-chip button {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1;
}

.filter-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--button-radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

.filter-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: var(--space-2xl);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    min-width: 320px;
    box-shadow: var(--shadow-large);
    z-index: 50;
}

.filter-group {
    margin-bottom: 1.25rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.filter-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

/* ============================================
   WARDROBE GRID
   ============================================ */

main {
    padding: var(--space-2xl);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.wardrobe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2xl);
}

.wardrobe-header h2 {
    font-family: var(--font-display);
}

.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-xl);
}

.wardrobe-item {
    background: var(--bg-surface);
    border-radius: var(--card-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border: 1px solid var(--border-subtle);
}

.wardrobe-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-large);
}

.wardrobe-item-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-elevated);
}

.wardrobe-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.wardrobe-item:hover img {
    transform: scale(1.08);
}

.item-info {
    padding: 1.25rem;
}

.item-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.item-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-tag {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.item-tag.color-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding-left: 0.375rem;
}

.color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
}

/* ============================================
   FAB
   ============================================ */

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-muted) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-large);
    z-index: 50;
    font-size: 24px;
    cursor: pointer;
}

.fab:hover {
    transform: scale(1.08) rotate(90deg);
}

/* ============================================
   SHEETS & MODALS
   ============================================ */

.sheet, .modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
}

.modal {
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.sheet-backdrop, .modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s var(--ease-out);
}

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

.sheet-content {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    margin: 0 auto;
    background: var(--bg-surface);
    border-radius: 1.5rem 1.5rem 0 0;
    overflow-y: auto;
    animation: slideUp 0.4s var(--ease-out);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.sheet-header, .modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    background: var(--bg-surface);
    border-radius: 1.25rem;
    overflow: hidden;
    animation: scaleIn 0.3s var(--ease-out);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* ============================================
   FORMS
   ============================================ */

.add-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a827a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

.form-group select:hover {
    border-color: var(--border-light);
    background-color: var(--bg-hover);
}

.form-group select:focus {
    outline: none;
    border-color: var(--accent-muted);
    background-color: var(--bg-hover);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-group select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.5rem;
}
.form-group label {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.625rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    transition: all 0.3s var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-muted);
    background: var(--bg-hover);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--bg-elevated);
    border: 2px dashed var(--border-light);
    border-radius: var(--card-radius);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.upload-area:hover {
    border-color: var(--accent-muted);
    background: var(--bg-hover);
}

.image-preview {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--card-radius);
    margin-top: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.form-actions button {
    flex: 1;
}

/* Color Input */
.color-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.color-text-input {
    flex: 1;
    padding-right: 3rem;
}

.color-picker-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border-light);
    cursor: pointer;
    overflow: hidden;
}

.color-picker-input {
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-display-square {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============================================
   USER MANAGER
   ============================================ */

.user-manager-container {
    max-width: 800px;
    margin: 0 auto;
}

.user-cards-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.user-card {
    background: var(--bg-elevated);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.user-card.current {
    border-color: var(--accent-muted);
}

.user-card:hover {
    box-shadow: var(--shadow-soft);
}

.user-card-header {
    background: linear-gradient(to right, var(--bg-surface), transparent);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.user-card-header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-lg);
    align-items: center;
}

.user-card-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-muted) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.user-card-title {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.user-name-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--button-radius);
    transition: all 0.2s var(--ease-out);
}

.user-name-input:hover {
    background: var(--bg-hover);
}

.user-name-input:focus {
    outline: none;
    background: var(--bg-hover);
    border-color: var(--accent-muted);
}

.user-role-badge {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-surface);
    border-radius: 4px;
    width: fit-content;
}

.user-card-actions {
    display: flex;
    gap: var(--space-sm);
}

.user-card-body {
    padding: var(--space-xl);
    background: var(--bg-surface);
}

.user-attributes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.attribute-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.attribute-label {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.attribute-input {
    padding: var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--button-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.skin-tone-section {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.skin-tone-picker {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-top: var(--space-md);
}

.skin-tone-preview {
    width: 80px;
    height: 80px;
    border-radius: var(--card-radius);
    border: 2px solid var(--border-light);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s var(--ease-out);
}

.skin-tone-preview:hover {
    transform: scale(1.05);
}

.skin-tone-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.skin-tone-info {
    flex: 1;
}

.skin-tone-hex {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.save-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-radius: var(--button-radius);
    color: var(--success);
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

.save-status.show {
    opacity: 1;
}

.add-user-button {
    width: 100%;
    padding: var(--space-lg);
    margin-top: var(--space-xl);
    background: var(--bg-elevated);
    border: 2px dashed var(--border-light);
    border-radius: var(--card-radius);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.add-user-button:hover {
    background: var(--bg-hover);
    border-color: var(--accent-muted);
    color: var(--accent);
}

/* ============================================
   DETAIL VIEW
   ============================================ */

.detail-content {
    padding: var(--space-xl);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.detail-label {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.color-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
}

.detail-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-2xl);
}

.detail-actions button {
    flex: 1;
}

.btn-edit {
    background: var(--bg-elevated);
    border: 1px solid var(--accent-muted);
    color: var(--accent);
}

/* ============================================
   UTILITIES
   ============================================ */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    header {
        padding: 0 var(--space-lg);
    }
    
    .ai-bar {
        padding: var(--space-lg);
    }
    
    main {
        padding: var(--space-lg);
    }
    
    .wardrobe-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-md);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .user-card-header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-md);
    }
    
    .user-card-avatar {
        margin: 0 auto;
    }
    
    .user-attributes {
        grid-template-columns: 1fr;
    }
    
    .user-selection-grid {
        grid-template-columns: 1fr;
    }
}
/* Small expand button */
#expandOutfitBtn {
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}
#expandOutfitBtn:hover { color: var(--text-primary); }
/* --- Outfit Builder Fullscreen --- */
.outfit-builder-panel.fullscreen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh !important;
}
.outfit-builder-panel.fullscreen #outfitRows {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
}

/* --- Accessories with individual remove buttons --- */
.accessory-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    display: inline-block;
    margin: 0.25rem;
}
.accessory-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.accessory-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0 0.25rem;
    border-radius: 0 0 0 4px;
}

/* --- Expand/Collapse small icon button --- */
#expandOutfitBtn {
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}
#expandOutfitBtn:hover {
    color: var(--text-primary);
}
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.toast {
    position: fixed;
    bottom: 2rem;
    right: 50%;
    transform: translateX(50%);
    background: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--button-radius);
    box-shadow: var(--shadow-large);
    z-index: 10000;
    animation: toastSlide 0.3s var(--ease-out);
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(50%) translateY(0);
    }
}
.saved-outfit-card {
    position: relative;
}

.saved-outfit-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    content: 'View Outfit';
    color: white;
    font-weight: 600;
    pointer-events: none;
}

.saved-outfit-card:hover::after {
    opacity: 1;
}
.confirm-modal {
    background: var(--bg-elevated);
    border-radius: var(--card-radius);
    padding: var(--space-xl);
    max-width: 400px;
    text-align: center;
}

.confirm-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}
#passwordInput{
    margin-top: 2rem;
}
@media (max-width: 640px) {
    .outfit-builder-header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .outfit-builder-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .outfit-builder-actions button {
        flex: 1;
        min-width: 120px;
    }
    
    .outfit-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}
.image-preview-container {
    position: relative;
}

.image-preview {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--card-radius);
}

.btn-remove-image {
    width: 100%;
    margin-top: var(--space-md);
    padding: 0.75rem 1rem;
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--button-radius);
    color: var(--error);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.btn-remove-image:hover {
    background: var(--error);
    color: white;
}

.btn-remove-image svg {
    flex-shrink: 0;
}
@keyframes itemFadeIn {
    from { 
        opacity: 0;
        transform: scale(0.95);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}
.more-items {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile fixes for outfit builder */
@media (max-width: 768px) {
    .outfit-builder-header {
        padding: var(--space-md);
        flex-wrap: wrap;
    }
    
    .outfit-builder-title {
        flex: 1 1 100%;
        margin-bottom: var(--space-sm);
    }
    
    .outfit-builder-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xs);
    }
    
    .outfit-builder-actions button {
        font-size: 0.8125rem;
        padding: 0.625rem 0.75rem;
        white-space: nowrap;
    }
    
    .outfit-builder-actions .btn-ghost {
        grid-column: span 2;
    }
    
    /* Outfit builder toggle button repositioning */
    .outfit-builder-toggle {
        bottom: 5rem; /* Move up to avoid FAB */
        left: 1rem;
        width: 48px;
        height: 48px;
    }
    
    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 56px;
        height: 56px;
    }
    
    /* Outfit slots mobile layout */
    .outfit-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .outfit-slot {
        min-height: 120px;
    }
    
    .outfit-slot-label {
        font-size: 0.6875rem;
    }
    
    /* Item selector mobile fixes */
    .item-selector-content {
        max-height: 90vh;
    }
    
    .item-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--space-md);
        max-height: calc(90vh - 200px);
    }
    
    .item-selector-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .item-selector-filters button {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .outfit-builder-actions {
        grid-template-columns: 1fr;
    }
    
    .outfit-builder-actions .btn-ghost {
        grid-column: 1;
    }
    
    .outfit-row-actions button {
        padding: 0.25rem;
    }
    
    .outfit-row-actions svg {
        width: 14px;
        height: 14px;
    }
}