/* ── Design Tokens ─────────────────────────────────── */
:root {
    --bg: #faf8f5;
    --surface: #ffffff;
    --surface-hover: #f7f5f2;
    --text: #2c2828;
    --text-muted: #9a9090;
    --text-light: #b8adad;
    --accent: #c9a87c;
    --accent-hover: #b8944f;
    --accent-light: #f5ede3;
    --danger: #d4534b;
    --danger-light: #fef2f1;
    --success: #5a9a6e;
    --border: #ebe6e0;
    --border-light: #f2ede8;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 2px 12px rgba(44, 40, 40, 0.05);
    --shadow-lg: 0 8px 30px rgba(44, 40, 40, 0.08);
    --shadow-hover: 0 8px 25px rgba(44, 40, 40, 0.1);
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: 0.2s ease;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Navbar ───────────────────────────────────────── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.92);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.navbar-stylist {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Container ────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 40px 60px;
}

/* ── Page Header ──────────────────────────────────── */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 4px;
    font-weight: 300;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--text);
    color: white;
}
.btn-primary:hover { background: #444; }

.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    background: var(--surface-hover);
    border-color: var(--text-muted);
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition);
    background: transparent;
    color: var(--text-light);
}

.btn-danger-icon:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ── Forms ─────────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition);
    min-width: 160px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-input-sm { min-width: 90px; max-width: 120px; }

.form-group-btn { align-self: flex-end; }

.hidden { display: none !important; }

/* ── Add Client Section ───────────────────────────── */
.add-client-section {
    margin-bottom: 32px;
}

.add-form {
    margin-top: 16px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

/* ── Clients Grid ─────────────────────────────────── */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.client-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.client-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.client-card-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.client-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent-light);
}

.client-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 36px;
    border-radius: 50%;
}

.client-info {
    flex: 1;
    min-width: 0;
}

.client-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 2px;
}

.client-age {
    font-size: 13px;
    color: var(--text-muted);
}

.client-mood {
    display: inline-block;
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-light);
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 6px;
}

.client-stats {
    margin-top: 6px;
}

.stat-badge {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 20px;
}

.client-date {
    color: var(--text-light);
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.client-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0;
    transition: opacity var(--transition);
}

.client-card:hover .client-delete { opacity: 1; }

/* ── Empty State ──────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text);
}

/* ── Client Detail Header ─────────────────────────── */
.back-link {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    transition: color var(--transition);
}
.back-link:hover { color: var(--text); }

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    padding: 28px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.client-header-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.client-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent-light);
}

.client-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-header-name {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
}

.client-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.mood-tag {
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.client-stats-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.stat-pill {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--accent);
    color: white;
    font-weight: 500;
}

.stat-pill-muted {
    background: var(--bg);
    color: var(--text-muted);
}

.client-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Edit Panel ───────────────────────────────────── */
.edit-panel {
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}

/* ── Add Items Modal ──────────────────────────────── */
.add-items-modal {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.add-items-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 24px;
}

.add-items-choices {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.add-items-choice {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
}

.add-items-choice:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.add-items-choice-icon {
    font-size: 32px;
}

.add-items-choice-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.add-items-choice-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ── Google Drive Section ────────────────────────── */
.gdrive-section {
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

.gdrive-url-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.gdrive-url-row .form-input {
    flex: 1;
    min-width: 0;
}

.gdrive-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 14px;
    justify-content: center;
}

.gdrive-folders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.gdrive-folders-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.gdrive-folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.gdrive-folder-item:hover {
    background: var(--surface-hover);
}

.gdrive-folder-item:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-light);
}

.gdrive-folder-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.gdrive-folder-count {
    font-size: 12px;
    color: var(--text-muted);
}

.gdrive-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.gdrive-actions {
    display: flex;
    justify-content: center;
}

/* ── Upload Progress Overlay ─────────────────────── */
.upload-progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.upload-progress-box {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 340px;
    max-width: 420px;
}

.upload-progress-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    text-align: center;
}

.upload-progress-bar-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.upload-progress-detail {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.upload-progress-steps {
    width: 100%;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.upload-step {
    font-size: 12px;
    color: var(--text-muted);
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
}

.upload-step.step-complete {
    color: var(--accent);
    font-weight: 500;
}

.upload-step.step-retry {
    color: #e67e22;
}

@media (max-width: 560px) {
    .add-items-choices {
        flex-direction: column;
    }
}

/* ── Spinner ──────────────────────────────────────── */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section Titles ───────────────────────────────── */
.section-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 400;
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

/* ── Wardrobe Header ──────────────────────────────── */
.wardrobe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* ── Category Tabs ────────────────────────────────── */
.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 68px;
    z-index: 50;
}

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.cat-tab:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.cat-tab.active {
    background: var(--accent);
    color: white;
}

.cat-tab-count {
    font-size: 11px;
    opacity: 0.7;
}

/* ── Manual Outfit Bar ────────────────────────────── */
.manual-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--accent-light);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 20px;
    position: sticky;
    top: 124px;
    z-index: 49;
}

.manual-bar-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.manual-bar-actions {
    display: flex;
    gap: 8px;
}

/* ── Manual Mode Item Selection ───────────────────── */
body.manual-mode .item-card {
    cursor: pointer;
    position: relative;
}

body.manual-mode .item-card:hover {
    border-color: var(--accent);
}

.item-check {
    display: none;
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 14px;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

body.manual-mode .item-check {
    display: flex;
    background: var(--border);
    color: transparent;
}

body.manual-mode .item-card.selected .item-check {
    background: var(--accent);
    color: white;
}

body.manual-mode .item-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

body.manual-mode .item-delete {
    display: none;
}

/* ── Category hide/show ───────────────────────────── */
.category-block.cat-hidden {
    display: none;
}

/* ── Category Block ───────────────────────────────── */
.category-block {
    margin-bottom: 32px;
}

.category-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.category-icon { font-size: 18px; }

.category-count {
    font-size: 13px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-weight: 400;
    letter-spacing: 0;
}

/* ── Items Grid ───────────────────────────────────── */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.item-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition);
}

.item-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.item-photo {
    position: relative;
    aspect-ratio: 1;
    background: #f8f6f3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
}

.item-photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.item-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card:hover .item-delete { opacity: 1; }
.item-delete:hover {
    background: var(--danger);
    color: white;
}

.item-details {
    padding: 12px;
}

.item-id {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

.item-subcategory {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-top: 2px;
    text-transform: capitalize;
}

.color-swatches {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--border);
    flex-shrink: 0;
}

.item-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent-hover);
    white-space: nowrap;
}

.tag-muted {
    background: var(--bg);
    color: var(--text-muted);
}

/* ── Outfit Section ───────────────────────────────── */
.outfit-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

.outfit-form {
    margin-bottom: 24px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.outfit-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.outfit-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition);
}

.outfit-card:hover {
    box-shadow: var(--shadow-lg);
}

.outfit-collage {
    position: relative;
}

.outfit-collage img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.outfit-score {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.score-high { background: var(--success); }
.score-mid { background: var(--accent); }
.score-low { background: var(--danger); }

.outfit-info {
    padding: 16px;
}

.outfit-items-list {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
}

.outfit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ── Wardrobe Header Actions ──────────────────────── */
.wardrobe-header-actions {
    display: flex;
    gap: 8px;
}

/* ── Button Variants ─────────────────────────────── */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}
.btn-danger:hover { background: #c0433c; }

/* ── Outfits Section ─────────────────────────────── */
.outfits-section {
    margin-top: 32px;
    padding: 28px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.outfits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.outfits-header-actions {
    display: flex;
    gap: 8px;
}

/* ── AI Outfit Panel ─────────────────────────────── */
.ai-outfit-panel {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.ai-outfit-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    min-height: 70px;
    margin-bottom: 12px;
}

.ai-outfit-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.ai-outfit-panel-actions {
    display: flex;
    gap: 8px;
}

.ai-outfit-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 14px;
    justify-content: center;
}

/* ── AI Outfit Results ───────────────────────────── */
.ai-outfit-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ai-outfit-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition);
}

.ai-outfit-card:hover {
    box-shadow: var(--shadow);
}

.ai-outfit-card-collage {
    position: relative;
    background: #faf9f7;
}

.ai-outfit-card-collage img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: contain;
}

.ai-outfit-card-info {
    padding: 12px 14px;
}

.outfit-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.outfit-description {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 6px;
}

.ai-outfit-card-items {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 6px;
}

.ai-outfit-card-actions {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
}

/* ── Saved Outfits Grid ──────────────────────────── */
.saved-outfits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.saved-outfit-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition);
}

.saved-outfit-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.saved-outfit-collage {
    position: relative;
    background: #faf9f7;
}

.saved-outfit-collage img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: contain;
}

.saved-outfit-info {
    padding: 12px 14px;
}

.saved-outfit-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.saved-outfit-score {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.saved-outfit-actions {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-light);
}

/* ── Save Outfit Dialog ──────────────────────────── */
.save-outfit-dialog {
    background: var(--surface);
    border-radius: var(--radius);
    width: 400px;
    max-width: 90vw;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.save-outfit-dialog h3 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
    text-align: center;
}

.save-outfit-dialog-content {
    margin-bottom: 20px;
}

.save-outfit-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ── Empty State Small ───────────────────────────── */
.empty-state-sm {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state-sm p {
    font-size: 14px;
}

/* ── Loading state for outfit ─────────────────────── */
.outfit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ── Edit Item Modal ───────────────────────────────── */
.edit-item-modal {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    width: 560px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.edit-item-body {
    display: flex;
    gap: 24px;
    padding: 32px;
}

.edit-item-preview {
    width: 180px;
    flex-shrink: 0;
    background: #f8f6f3;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    align-self: flex-start;
}

.edit-item-preview img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.edit-item-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.edit-item-form .form-group {
    gap: 4px;
}

.edit-colors-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-colors-row .form-input {
    flex: 1;
    min-width: 0;
}

.checkbox-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.checkbox-label:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.tag-season {
    background: #e8f4ec;
    color: #4a8c5c;
}

.edit-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 560px) {
    .edit-item-body {
        flex-direction: column;
    }
    .edit-item-preview {
        width: 100%;
        max-height: 180px;
    }
}

/* ── Toast ─────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: white;
    font-size: 13px;
    animation: toast-in 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Footer ───────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
}

/* ── Try-on Modal ─────────────────────────────────── */
.tryon-modal {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    width: 700px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.tryon-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    margin-bottom: 24px;
    text-align: center;
}

.tryon-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.tryon-preview-multi {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.tryon-mannequin-col,
.tryon-garments-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tryon-img-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 500;
}

.tryon-mannequin-col img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #f8f6f3;
    padding: 8px;
}

.tryon-garments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    width: 100%;
}

.tryon-garment-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #f8f6f3;
    border-radius: var(--radius-sm);
    padding: 8px;
}

.tryon-garment-item img {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.tryon-garment-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.tryon-result {
    width: 100%;
    text-align: center;
}

.tryon-result img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.tryon-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
}

.tryon-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.tryon-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--danger);
    font-size: 13px;
    background: var(--danger-light);
    border-radius: var(--radius-sm);
    width: 100%;
    text-align: center;
}

/* ── Collage Editor Modal ─────────────────────────── */
.collage-editor-modal {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    width: 900px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.collage-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.collage-editor-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
}

.collage-editor-actions {
    display: flex;
    gap: 8px;
}

.collage-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.collage-canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.collage-canvas {
    position: relative;
    background: #fff;
    background-image:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.collage-item {
    position: absolute;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: box-shadow 0.15s ease;
    user-select: none;
}

.collage-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.collage-item.dragging {
    cursor: grabbing;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    z-index: 999 !important;
    transform: scale(1.02);
}

.collage-item img {
    width: 100%;
    height: calc(100% - 24px);
    object-fit: contain;
    pointer-events: none;
}

.collage-item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    padding: 2px 4px;
    background: rgba(255,255,255,0.85);
    border-radius: 0 0 6px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
}

.collage-item-controls {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.collage-item:hover .collage-item-controls {
    opacity: 1;
}

.collage-resize-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    line-height: 1;
}

.collage-resize-btn:hover {
    background: var(--accent);
    color: white;
}

.collage-editor-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 12px 20px; }
    .container { padding: 20px; }
    .page-title { font-size: 32px; }
    .client-header { flex-direction: column; }
    .client-header-actions { width: 100%; }
    .form-row { flex-direction: column; }
    .form-input { min-width: 100%; }
    .form-input-sm { max-width: 100%; }
    .items-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .outfit-results { grid-template-columns: 1fr; }
    .ai-outfit-results { grid-template-columns: 1fr; }
    .saved-outfits-grid { grid-template-columns: 1fr; }
    .outfits-header { flex-direction: column; gap: 12px; }
    .wardrobe-header-actions { width: 100%; justify-content: flex-end; }

    .tryon-modal { padding: 20px; }
    .tryon-preview-multi { grid-template-columns: 1fr; }
    .collage-editor-modal { width: 100%; max-width: 100vw; max-height: 100vh; border-radius: 0; }
}
