/* =============================================================================
   BUILT BUILDER - Modern UI Styles
   ============================================================================= */

/* Container */
.builder-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* =============================================================================
   HERO BANNER
   ============================================================================= */
.builder-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(139, 92, 246, 0.08));
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.hero-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

    .hero-icon .material-symbols-outlined {
        font-size: 1.75rem;
        color: #fff;
    }

.hero-text h2 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.hero-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =============================================================================
   STEP PROGRESS
   ============================================================================= */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0.75rem;
}

    .step-item:hover {
        background: rgba(37, 99, 235, 0.05);
    }

.step-number {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

    .step-number .step-num {
        color: #64748b;
        transition: all 0.3s ease;
    }

    .step-number .step-check {
        position: absolute;
        font-size: 1.25rem;
        color: #fff;
        opacity: 0;
        transform: scale(0);
        transition: all 0.3s ease;
    }

.step-item.active .step-number {
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

    .step-item.active .step-number .step-num {
        color: #fff;
    }

.step-item.completed .step-number {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

    .step-item.completed .step-number .step-num {
        opacity: 0;
        transform: scale(0);
    }

    .step-item.completed .step-number .step-check {
        opacity: 1;
        transform: scale(1);
    }

.step-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.step-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    transition: color 0.3s ease;
}

.step-item.active .step-label {
    color: var(--accent);
}

.step-item.completed .step-label {
    color: #10b981;
}

.step-desc {
    font-size: 0.75rem;
    color: #94a3b8;
}

.step-connector {
    width: 4rem;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 0 0.5rem;
    position: relative;
    overflow: hidden;
}

.connector-line {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
}

.connector-progress {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #10b981, #059669);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.step-connector.completed .connector-progress {
    transform: scaleX(1);
}

/* =============================================================================
   STEP CONTENT
   ============================================================================= */
.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

    .step-content.active {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   FORM CARDS
   ============================================================================= */
.form-card {
    background: var(--surface);
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    transition: all 0.3s ease;
}

    .form-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }

    .form-card.highlight {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(139, 92, 246, 0.03));
        border-color: rgba(37, 99, 235, 0.2);
    }

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0;
}

.card-icon {
    width: 2.75rem;
    height: 2.75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .card-icon .material-symbols-outlined {
        font-size: 1.4rem;
        color: var(--accent);
    }

    .card-icon.blue {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    }

        .card-icon.blue .material-symbols-outlined {
            color: #3b82f6;
        }

    .card-icon.purple {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    }

        .card-icon.purple .material-symbols-outlined {
            color: #8b5cf6;
        }

    .card-icon.green {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    }

        .card-icon.green .material-symbols-outlined {
            color: #10b981;
        }

    .card-icon.orange {
        background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.05));
    }

        .card-icon.orange .material-symbols-outlined {
            color: #f97316;
        }

.card-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
}

.card-title p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-body {
    padding: 1.25rem;
}

    .card-body.centered {
        text-align: center;
        padding: 2rem 1.25rem;
    }

/* =============================================================================
   FORM ELEMENTS
   ============================================================================= */
.form-group {
    margin-bottom: 1rem;
}

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

    .form-group > label {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 0.5rem;
    }

        .form-group > label .material-symbols-outlined {
            font-size: 1.1rem;
        }

.select-wrapper {
    position: relative;
}

    .select-wrapper select {
        width: 100%;
        padding: 0.85rem 2.5rem 0.85rem 1rem;
        border: 1.5px solid #e2e8f0;
        border-radius: 0.75rem;
        font-size: 0.95rem;
        background: #fff;
        color: var(--text-dark);
        appearance: none;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .select-wrapper select:hover {
            border-color: #cbd5e1;
        }

        .select-wrapper select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

.select-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1.25rem;
}

.text-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

    .text-input:hover {
        border-color: #cbd5e1;
    }

    .text-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .text-input::placeholder {
        color: #94a3b8;
    }

.input-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

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

/* =============================================================================
   SOURCE TOGGLE
   ============================================================================= */
.source-toggle {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    margin-bottom: 1.25rem;
}

.source-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

    .source-btn:hover {
        color: var(--text-dark);
        background: rgba(255, 255, 255, 0.5);
    }

    .source-btn.active {
        background: #fff;
        color: var(--accent);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .source-btn .material-symbols-outlined {
        font-size: 1.2rem;
    }

/* =============================================================================
   UPLOAD DROPZONE
   ============================================================================= */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.5), rgba(248, 250, 252, 0.5));
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .upload-dropzone:hover {
        border-color: var(--accent);
        background: rgba(37, 99, 235, 0.03);
    }

    .upload-dropzone.dragover {
        border-color: var(--accent);
        background: rgba(37, 99, 235, 0.08);
        transform: scale(1.01);
    }

    .upload-dropzone input[type="file"] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

.upload-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.upload-text {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.upload-subtext {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =============================================================================
   BLUEPRINT GRID
   ============================================================================= */
.blueprint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-top: 1rem;
}

.blueprint-photo-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.25s ease;
}

    .blueprint-photo-item:hover {
        border-color: var(--accent);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    .blueprint-photo-item.selected {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    }

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

.blueprint-floor-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.6rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 0.375rem;
    backdrop-filter: blur(4px);
}

.selection-number {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.blueprint-photo-item.selected .selection-number {
    display: flex;
}

/* =============================================================================
   SELECTED PREVIEW - Thumbnails at bottom
   ============================================================================= */
.selected-preview {
    margin-top: 1rem;
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

    .preview-label .material-symbols-outlined {
        font-size: 1rem;
    }

.selected-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-blueprint-thumb {
    position: relative;
    width: 70px;
    height: 52px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--accent);
    background: #f8fafc;
}

    .selected-blueprint-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .selected-blueprint-thumb .thumb-number {
        position: absolute;
        top: 2px;
        left: 2px;
        width: 1.1rem;
        height: 1.1rem;
        background: var(--accent);
        color: #fff;
        font-size: 0.65rem;
        font-weight: 700;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* =============================================================================
   SELECTION INFO
   ============================================================================= */
.selection-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.04));
    border-radius: 0.75rem;
    margin-top: 1rem;
}

.selection-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--accent);
}

    .selection-badge .material-symbols-outlined {
        font-size: 1.1rem;
    }

.clear-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--accent);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .clear-btn:hover {
        background: var(--accent);
        color: #fff;
    }

    .clear-btn .material-symbols-outlined {
        font-size: 1rem;
    }

/* =============================================================================
   SELECTED PREVIEW
   ============================================================================= */
.selected-preview {
    margin-top: 1rem;
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

    .preview-label .material-symbols-outlined {
        font-size: 1.1rem;
    }

.selected-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.selected-blueprint-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid var(--accent);
    background: #f8fafc;
}

    .selected-blueprint-item img {
        width: 100%;
        height: 100px;
        object-fit: contain;
        background: #fff;
    }

.blueprint-label {
    display: block;
    padding: 0.5rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-blueprint {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-blueprint-item:hover .remove-blueprint {
    opacity: 1;
}

/* =============================================================================
   FLOOR DROPDOWN
   ============================================================================= */
.floor-checkbox-container {
    position: relative;
}

.floor-toggle-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fff;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

    .floor-toggle-btn:hover {
        border-color: #cbd5e1;
    }

    .floor-toggle-btn.open {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.selected-floors-text {
    color: #94a3b8;
}

    .selected-floors-text.has-selection {
        color: var(--text-dark);
        font-weight: 500;
    }

.floor-toggle-btn .material-symbols-outlined {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.floor-toggle-btn.open .material-symbols-outlined {
    transform: rotate(180deg);
}

.floor-dropdown-panel {
    position: fixed;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.25s ease;
    width: auto;
    min-width: 200px;
}

    .floor-dropdown-panel.open {
        max-height: 280px;
        overflow-y: auto;
        opacity: 1;
        padding: 0.5rem;
    }

.floor-check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease;
    margin: 0;
}

    .floor-check-item:hover {
        background: #f1f5f9;
    }

    .floor-check-item input[type="checkbox"] {
        width: 1.1rem;
        height: 1.1rem;
        accent-color: var(--accent);
        cursor: pointer;
    }

.floor-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floor-name {
    font-weight: 500;
    color: var(--text-dark);
}

.floor-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.floor-select-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

    .floor-select-actions button {
        flex: 1;
        padding: 0.5rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
        font-size: 0.8rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.15s ease;
    }

        .floor-select-actions button:hover {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }

/* =============================================================================
   ACTION BUTTONS
   ============================================================================= */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

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

    .action-btn .material-symbols-outlined {
        font-size: 1.25rem;
    }

    .action-btn.primary {
        background: linear-gradient(135deg, var(--accent), #3b82f6);
        color: #fff;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

        .action-btn.primary:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
        }

        .action-btn.primary.large {
            padding: 1.1rem 2rem;
            font-size: 1.05rem;
        }

    .action-btn.secondary {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
        color: var(--accent);
        border: 1.5px solid rgba(37, 99, 235, 0.2);
    }

        .action-btn.secondary:hover:not(:disabled) {
            background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.08));
            border-color: var(--accent);
        }

    .action-btn.outline {
        background: transparent;
        color: var(--accent);
        border: 1.5px dashed rgba(37, 99, 235, 0.3);
    }

        .action-btn.outline:hover:not(:disabled) {
            background: rgba(37, 99, 235, 0.05);
            border-style: solid;
            border-color: var(--accent);
        }

.action-hint {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Button Loader */
.btn-loader {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin 0.8s linear infinite;
}

.action-btn.loading .btn-loader {
    display: block;
}

.action-btn.loading span:not(.btn-loader) {
    opacity: 0.7;
}

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

/* =============================================================================
   DETECTED UNITS
   ============================================================================= */
.detected-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

    .section-label .material-symbols-outlined {
        font-size: 1.15rem;
        color: var(--accent);
    }

.unit-count {
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.25rem;
}

.unit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    min-height: 60px;
}

.unit-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    background: #fff;
    color: var(--text-dark);
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .unit-chip:hover {
        border-color: var(--accent);
        background: rgba(37, 99, 235, 0.05);
        transform: translateY(-1px);
    }

    .unit-chip.assigned {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
        border-color: #10b981;
        color: #059669;
    }

        .unit-chip.assigned::after {
            content: "✓";
            margin-left: 0.35rem;
            font-size: 0.75rem;
        }

/* =============================================================================
   ASSIGNMENT LIST
   ============================================================================= */
.assignment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

    .assignment-list:empty {
        display: none;
    }

    .assignment-list + .action-btn {
        width: 100%;
    }

/* Unit Row */
.code-row, .builder-unit-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

    .code-row input[type="text"],
    .builder-unit-row input[type="text"] {
        padding: 0.65rem 0.85rem;
        border: 1.5px solid #e2e8f0;
        border-radius: 0.5rem;
        font-size: 0.9rem;
        background: #fff;
        transition: all 0.2s ease;
    }

        .code-row input[type="text"]:focus,
        .builder-unit-row input[type="text"]:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

/* Code Checkbox Dropdown */
.code-checkbox-container {
    position: relative;
}

.code-toggle-btn {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

    .code-toggle-btn:hover {
        border-color: #cbd5e1;
    }

    .code-toggle-btn.open {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.selected-codes-text {
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

    .selected-codes-text.has-selection {
        color: var(--text-dark);
        font-weight: 500;
    }

.code-toggle-btn .material-symbols-outlined {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.code-toggle-btn.open .material-symbols-outlined {
    transform: rotate(180deg);
}

.code-dropdown-panel {
    position: fixed;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.25s ease;
    min-width: 200px;
}

    .code-dropdown-panel.open {
        max-height: 220px;
        overflow-y: auto;
        opacity: 1;
        padding: 0.5rem;
    }

.code-check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s ease;
    margin: 0;
    font-weight: normal;
}

    .code-check-item:hover {
        background: #f1f5f9;
    }

    .code-check-item input[type="checkbox"] {
        width: 1rem;
        height: 1rem;
        accent-color: var(--accent);
    }

/* Photo Button */
.builder-add-photo-btn {
    padding: 0.6rem !important;
    min-width: auto !important;
    border-radius: 0.5rem !important;
    background: rgba(37, 99, 235, 0.08);
    border: 1.5px solid rgba(37, 99, 235, 0.2);
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .builder-add-photo-btn:hover {
        background: rgba(37, 99, 235, 0.15);
        border-color: var(--accent);
    }

    .builder-add-photo-btn .material-symbols-outlined {
        font-size: 1.1rem;
    }

    .builder-add-photo-btn.has-photos {
        background: rgba(16, 185, 129, 0.1);
        border-color: #10b981;
        color: #059669;
    }

/* Remove Button */
.code-row button.icon,
.builder-unit-row button.icon {
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .code-row button.icon:hover,
    .builder-unit-row button.icon:hover {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
    }

/* =============================================================================
   RESULT CARD
   ============================================================================= */
.result-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.03));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-top: 1rem;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.result-icon {
    font-size: 1.5rem;
    color: #10b981;
}

.result-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #059669;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.annotated-map-preview-item {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

    .annotated-map-preview-item .map-label {
        display: block;
        padding: 0.5rem 0.75rem;
        background: #f8fafc;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--text-muted);
        border-bottom: 1px solid #e2e8f0;
    }

    .annotated-map-preview-item img {
        width: 100%;
        max-height: 150px;
        object-fit: contain;
        padding: 0.5rem;
    }

/* =============================================================================
   STATUS TOAST
   ============================================================================= */
.status-toast {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    animation: slideUp 0.3s ease;
}

    .status-toast.success {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
        color: #059669;
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   STEP NAVIGATION
   ============================================================================= */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

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

    .nav-btn.primary {
        background: linear-gradient(135deg, var(--accent), #3b82f6);
        color: #fff;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

        .nav-btn.primary:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
        }

        .nav-btn.primary.export {
            background: linear-gradient(135deg, #10b981, #059669);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

            .nav-btn.primary.export:hover:not(:disabled) {
                box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
            }

    .nav-btn.secondary {
        background: #f1f5f9;
        color: var(--text-muted);
        border: 1px solid #e2e8f0;
    }

        .nav-btn.secondary:hover:not(:disabled) {
            background: #e2e8f0;
            color: var(--text-dark);
        }

    .nav-btn .material-symbols-outlined {
        font-size: 1.15rem;
    }

    .nav-btn .btn-loader {
        width: 1rem;
        height: 1rem;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: #fff;
        border-radius: 50%;
        display: none;
        animation: spin 0.8s linear infinite;
    }

    .nav-btn.loading .btn-loader {
        display: block;
    }

/* =============================================================================
   SUMMARY GRID (Step 2)
   ============================================================================= */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
    border-radius: 0.5rem;
    color: var(--accent);
    font-size: 1.25rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* =============================================================================
   MAP COMPARISON (Step 2)
   ============================================================================= */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.comparison-panel {
    background: #f8fafc;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

    .panel-header .material-symbols-outlined {
        font-size: 1.1rem;
    }

    .panel-header.annotated {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
        color: #059669;
    }

.map-preview {
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

    .map-preview .empty-state {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        color: #94a3b8;
        padding: 2rem;
    }

        .map-preview .empty-state .material-symbols-outlined {
            font-size: 2.5rem;
            opacity: 0.5;
        }

        .map-preview .empty-state p {
            margin: 0;
            font-size: 0.85rem;
        }

.review-map-item {
    position: relative;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

    .review-map-item .map-number {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
        width: 1.5rem;
        height: 1.5rem;
        background: var(--accent);
        color: #fff;
        font-size: 0.75rem;
        font-weight: 700;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
    }

    .review-map-item img {
        width: 100%;
        max-height: 180px;
        object-fit: contain;
    }

/* =============================================================================
   PHOTOS GRID (Step 2)
   ============================================================================= */
.photos-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

    .photos-grid .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 2rem;
        background: #f8fafc;
        border-radius: 0.75rem;
        border: 1px dashed #cbd5e1;
        color: #94a3b8;
    }

        .photos-grid .empty-state .material-symbols-outlined {
            font-size: 2.5rem;
            opacity: 0.5;
        }

        .photos-grid .empty-state p {
            margin: 0;
            font-size: 0.85rem;
        }

.review-unit-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.review-unit-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.review-unit-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.review-unit-code {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border-radius: 999px;
    font-weight: 600;
}

.review-unit-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
}

.review-unit-photo {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

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

/* =============================================================================
   EXPORT OPTIONS (Step 2)
   ============================================================================= */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .export-option:hover {
        border-color: #cbd5e1;
        background: #fff;
    }

    .export-option input[type="checkbox"] {
        display: none;
    }

        .export-option input[type="checkbox"]:checked + .option-content + .option-check {
            opacity: 1;
            color: #10b981;
        }

        .export-option input[type="checkbox"]:checked ~ .option-content .option-icon {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
            color: #10b981;
        }

    .export-option:has(input:checked) {
        border-color: rgba(16, 185, 129, 0.3);
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.03), rgba(16, 185, 129, 0.01));
    }

.option-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
    border-radius: 0.5rem;
    color: var(--accent);
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.option-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.option-check {
    font-size: 1.5rem;
    color: #cbd5e1;
    opacity: 0.5;
    transition: all 0.2s ease;
}

/* =============================================================================
   RESPONSIVE STYLES
   ============================================================================= */
@media (max-width: 768px) {
    .builder-container {
        overflow-x: hidden;
    }

    .builder-hero {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .form-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .card-body {
        overflow: hidden;
    }

    .form-group {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .browse-grid {
        grid-template-columns: 1fr;
        width: 100%;
        min-width: 0;
    }

    .floor-checkbox-container {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .floor-toggle-btn {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
        overflow: hidden;
    }

    .selected-floors-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
        flex: 1;
        max-width: calc(100% - 2rem);
    }

    .select-wrapper {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

        .select-wrapper select {
            width: 100%;
            box-sizing: border-box;
            min-width: 0;
        }

    .step-progress {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }

    .step-connector {
        width: 4px;
        height: 2rem;
        margin: 0;
    }

    .connector-progress {
        transform: scaleY(0);
        transform-origin: top;
    }

    .step-connector.completed .connector-progress {
        transform: scaleY(1);
    }

    .step-item {
        width: 100%;
        justify-content: center;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Assignment list mobile fixes */
    .assignment-list {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .code-row,
    .builder-unit-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

        .code-row > *,
        .builder-unit-row > * {
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

            .code-row > *:last-child,
            .builder-unit-row > *:last-child {
                justify-self: end;
                width: auto;
            }

        .code-row input[type="text"],
        .builder-unit-row input[type="text"] {
            width: 100%;
            box-sizing: border-box;
            min-width: 0;
        }

    .code-checkbox-container {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .code-toggle-btn {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
        overflow: hidden;
    }

    .selected-codes-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
        flex: 1;
        max-width: calc(100% - 2rem);
    }

    .step-nav {
        flex-direction: column;
        gap: 0.75rem;
    }

        .step-nav > * {
            width: 100%;
            justify-content: center;
        }

    .nav-btn.secondary {
        order: 1;
    }
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
    border-radius: inherit;
}

.loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e2e8f0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* =============================================================================
   DARK MODE SUPPORT (optional)
   ============================================================================= */
@media (prefers-color-scheme: dark) {
    .form-card {
        background: #1e293b;
        border-color: #334155;
    }

    .card-body {
        color: #e2e8f0;
    }

    .text-input,
    .select-wrapper select,
    .floor-toggle-btn,
    .code-toggle-btn {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }

    .unit-chips,
    .assignment-list .code-row,
    .assignment-list .builder-unit-row {
        background: #0f172a;
        border-color: #334155;
    }

    .unit-chip {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
}

/* Export Includes List */
.export-includes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.include-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #166534;
    font-size: 0.9rem;
    font-weight: 500;
}

    .include-item .material-symbols-outlined {
        font-size: 1.25rem;
        color: #16a34a;
    }

/* Additional Email Section */
.additional-email-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

.email-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s ease;
}

    .email-toggle:hover {
        border-color: var(--accent);
        background: rgba(37, 99, 235, 0.03);
    }

    .email-toggle input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
        accent-color: var(--accent);
    }

    .email-toggle .toggle-content {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--text-dark);
        font-weight: 500;
    }

    .email-toggle .material-symbols-outlined {
        color: var(--accent);
        font-size: 1.25rem;
    }

.additional-email-input {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    animation: slideDown 0.2s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.additional-email-input label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

    .additional-email-input label .material-symbols-outlined {
        font-size: 1.15rem;
    }
