.profile-container {
    padding: 24px;
}

.profile-shell {
    max-width: 920px;
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.profile-head {
    background: linear-gradient(to bottom right, var(--surface), var(--surface-soft));
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
}

.profile-head::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 4px solid var(--surface);
    box-shadow: 0 0 0 2px var(--accent-soft), 0 8px 16px rgba(40, 116, 240, 0.15);
    background: var(--surface-soft);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-soft), var(--surface-strong));
    color: var(--accent);
}

.profile-head h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
    color: var(--text);
}

.profile-head p {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 4px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.stat-card h3 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.stat-card p {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.profile-panel {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.profile-panel h2 {
    margin-bottom: 16px;
    font-size: 1.3rem;
    color: var(--text);
    border-bottom: 2px solid var(--surface-soft);
    padding-bottom: 12px;
}

.recent-orders {
    display: grid;
    gap: 12px;
}

.recent-order-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 110px 130px;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    background: var(--surface-soft);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.recent-order-row:hover {
    background: var(--surface);
    border-color: var(--accent-soft);
    box-shadow: 0 4px 12px rgba(40, 116, 240, 0.08);
    transform: translateX(4px);
}

.recent-order-row strong {
    justify-self: end;
    color: var(--accent);
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.profile-actions .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 999px;
}

.profile-edit-form {
    max-width: 640px;
    display: grid;
    gap: 16px;
}

.profile-edit-form .form-row {
    display: grid;
    gap: 8px;
}

.profile-edit-form label {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

.profile-edit-form input,
.profile-edit-form textarea,
.profile-edit-form select {
    width: 100%;
    border: 2px solid var(--surface-strong);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--surface-soft);
    color: var(--text);
    transition: all 0.3s ease;
}

.profile-edit-form input:focus,
.profile-edit-form textarea:focus,
.profile-edit-form select:focus {
    border-color: var(--accent);
    background: var(--surface);
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.1);
}

.profile-edit-form textarea {
    min-height: 120px;
    resize: vertical;
}

.profile-edit-form .current-image img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.profile-edit-form .form-row:last-child {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .recent-order-row {
        grid-template-columns: 1fr 1fr;
    }

    .recent-order-row strong {
        justify-self: start;
    }
}

@media (max-width: 560px) {
    .profile-container {
        padding: 16px;
    }

    .profile-head {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }

    .profile-edit-form .form-row:last-child {
        flex-direction: column;
        align-items: stretch;
    }
}
